[flexcoders] Re: Socket Connection to Port 80 on Serving Host

2007-05-30 Thread lieut_data
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 flexcoders@yahoogroups.com, 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 _Partsfile=1952. html#145389 
 
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1952.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





[flexcoders] Re: Socket Connection to Port 80 on Serving Host

2007-05-30 Thread lieut_data
Hi Jobe,

There are no stupid questions :D

I have no socket server running on port 80 -- simply a custom built
http server. What I want to do is use the Sockets functionality built
into Flash to communicate over port 80 with my web server. (You could
think of this as building a web browser inside flash using raw
sockets). I don't know exactly what a Socket server is, but I'm
using sockets as defined by wikipedia, an end-point in the IP
networking protocol.

--- In flexcoders@yahoogroups.com, Jobe Makar [EMAIL PROTECTED] wrote:

 Hi Jesse,
 
 Stupid question, but are you serving up your SWF on port 80 and then
trying to connect to a socket server at the same location on port 80?
If so, then port 80 is already in use.
 
 Jobe Makar
 http://www.electrotank.com
 http://www.electro-server.com
 phone: 252-627-8026
 mobile: 919-609-0408
 fax: 919-882-1121





[flexcoders] Re: Socket Connection to Port 80 on Serving Host

2007-05-30 Thread lieut_data
Essentially, the problem boils down to this:

If you want to connect to a socket on a different host than the one
from which the connecting SWF file was served, or if you want to
connect to a port lower than 1024 on any host, you must obtain an
xmlsocket: policy file from the host to which you are connecting.
---http://livedocs.adobe.com/flex/2/langref/flash/net/Socket.html#connect()

Why do I need to implement an XMLSocket server, to open a Socket to a
service on my server that isn't an XMLSocket service? Why can't it get
the information it needs from an HTTP resource?

A policy file obtained from an HTTP server implicitly authorizes
socket access to all ports 1024 and above; any to-ports attributes in
an HTTP policy file are ignored.
---http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1952.html#145389

It seems as though the intent is to prevent the Flash player from
communicating, using Sockets, to any standard HTTP server setup (port
80 open, nothing else). Why?

-- 
Jesse Hallam
University of Waterloo Junior


--- In flexcoders@yahoogroups.com, Jesse Hallam [EMAIL PROTECTED] 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_Partsfile=1952.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 )
 
 
 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
 
 -- 
 Jesse Hallam
 University of Waterloo Junior
 
 For scarcely for a righteous man will one die: yet peradventure for
a good
 man some would even dare to die. But God commendeth his love toward
us, in
 that, *while we were yet sinners*, Christ died for us.  (Romans 5:7, 8)





[flexcoders] Re: Disabling Selectable Text for a ComboBox

2007-05-17 Thread lieut_data
And yet another workaround, IMHO cleaner, is to set the editable =
false immediately after setting enabled = false in actionscript.

--- In flexcoders@yahoogroups.com, Brendan Meutzner [EMAIL PROTECTED]
wrote:

 Another workaround is to nest the ComboBox in a Canvas container and
then
 enable/disable the Canvas... you can see a tiny bit of disabled coloring
 bleeding over the radius of the ComboBox corners, but you've really
gotta be
 looking.
 
 Brendan