XMLSocket working in firefox but not IE

2019-08-24 04:51发布

问题:

I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox.

It uses the following line to setup the security policy:

System.security.loadPolicyFile("xmlsocket://localhost:10032");

Running the flash app under firefox, the service listening on port 10032 gets a connection with a <policy-file-request/>, responds to it, and it works well. Under IE, the service never gets the connection and the subsequent socket connection do not work.

EDIT: The problem turned out to be caused by embedding flash in a hidden div tag. In that case it refused to send out the policy file request. With the div not hidden it works. The answer about different versions of flash between FF and IE was right on, that's why it was working in FF (it was an older version). The newer version didn't like the hidden DIV tag.

回答1:

Are you certain the exact same version of flash is running on both browsers? The requirements for network security seem to have changed significantly between versions. It's entirely possible to have different versions of flash player installed into IE and firefox as one is an activeX control and the other a browser plugin.



回答2:

Add "new line" byte to the end of sending request to policy file.

Like this: "" + "\n"