Hi Paul,

I'm packet sniffing my .swf as it runs:

====SENT====
GET /crossdomain.xml HTTP/1.1
Host: my_host_name
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

====RECEIVED====
HTTP/1.0 200 OK
Cache-Control: max-age=300
Content-Type: text/xml
Content-Length: 217
Accept-Ranges: bytes
Last-Modified: Tue, 29 May 2007 17:45:47 GMT
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd";>
<cross-domain-policy>
    <allow-access-from domain="*" to-ports="80" />
</cross-domain-policy>

===FLASH ERROR===
Error #2044: Unhandled securityError:. text=Error #2048: Security
sandbox violation: http://my_host_name/my_swf_file.swf cannot load
data from my_host_name:80.



--- In [email protected], Paul deCoursey <[EMAIL PROTECTED]> wrote:
>
> I think that if you load the crossdomain file with the socket info
in it 
> it will work.  I don't think it needs to come from an xmlsocket.
> 
> Jesse Hallam wrote:
> >
> > I'm surprised how many walls I've run into trying to solve this, 
> > fairly simple problem.
> >
> > Essentially, I need to perform RPC style communication with the
server 
> > hosting the .swf. The server, which is also under my control, 
> > communicates custom binary data over HTTP, expecting HTTP POST 
> > requests from the client. Part of its response includes custom
headers 
> > to indicate the status of the request, with the body containing the 
> > raw binary data needed.
> >
> > Of course, neither the Flex HTTPService, URLLoader, or URLStream
allow 
> > me to parse custom response headers (not to mention setting some 
> > strange restrictions on which headers I can transmit). Instead, I 
> > turned to Sockets in the hopes of writing my own, more FLEXible HTTP 
> > client.
> >
> > Alas, I cannot seem to use Sockets to open a connection to port 80 on 
> > the host serving the .swf. From the following documentation:
> >
> > http://livedocs. adobe.com/ flex/2/docs/ wwhelp/wwhimpl/ common/html/ 
> > wwhelp.htm? context=LiveDocs _Parts&file=00001952. html#145389 
> >
<http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001952.html#145389>
> >
> > I learn several things:
> >
> >     * Socket communication requires a socket policy file, distinct
> >       from a document policy file
> >     * A socket policy file must be obtained using the same
> >       communication protocol as the socket (i.e. a socket opened on
> >       port 501 requires a socket policy file from port 501)
> >     * A socket policy file can be used to allow port access to ports <
> >       1024
> >     * A special syntax, 'xmlsocket:// server:port/ crossdomain. xml'
> >       can be used to request a socket policy file from a different
port
> >     * Using loadPolicyFile and a standard document policy file, access
> >       to ports > 1024 are implicitly enabled, and any 'to-ports'
> >       settings in the configuration file are ignored.
> >
> > Basically, at the end of the day, I want a .swf served from a host to 
> > be able to open socket connection on port 80 back to the server that 
> > hosted it to do HTTP operations. I cannot seem to be able to do this 
> > unless I:
> >
> >     * Open another port < 1024 to serve a socket policy file
> >     * Modify the server to respond to the Flash request for a socket
> >       policy file ( http://www.blog. lessrain. com/?p=512
> >       <http://www.blog.lessrain.com/?p=512>)
> >
> >
> > Why must it be so difficult to access the response headers from an 
> > HTTP connection?! This isn't a crossdomain issue at all -- this is 
> > communication with the very same host that served the .swf file in
the 
> > first place.
> >
> > Has anyone managed to overcome this issue cleanly?
> > Any input from more experienced Flex coders?
> >
> > Any help would be greatly appreciated :)
> >
> > Reference post, that yielded inconclusive results:
> > http://tech. groups.yahoo. com/group/ flexcoders/ message/71730 
> > <http://tech.groups.yahoo.com/group/flexcoders/message/71730>
> >
> > -- 
> > Jesse Hallam
> > University of Waterloo Junior
>


Reply via email to