ActionScript 3.0 :: Socket Sending Policy-file-request Twice?

Dec 8, 2009

Running my Flash app from localhost (in debug) I can connect/contact the socket server just fine. Note: It doesn't seem as though the server detects any 843 connection (e.g. the policy file port) this way. However, when I move the app to the server itself and run it from there (i.e. from the website), it will send the policy file, get a disconnect (as it should), and then try to execute the regular port stuff but doesn't read anything from Flash. It seems like my Flash app isn't writing to the port as it should, or something else is going wrong. I did also notice that Flash seems to be trying to send the policy-file-request twice.My process right now is like this:

1) Flash tries to connect to port 843. The server responds to its <policy-file-request/> with the policy file.

2) Flash reads it, disconnects from 843

3) Server gets graceful disconnect, then gets another connection on 843.

4) Just after that, the server gets a connection on 2188, but reads another <policy-file-request/>, so sends the policy file again.

5) At this point, Flash SHOULD simply write the string "Test" to the socket (that's in my connect handler). However, my server doesn't seem to read anything on the socket after the second <policy-file-request/>.[code]

View 1 Replies


Similar Posts:


ActionScript 3.0 :: By-Passing <policy-file-request/>?

Jul 11, 2007

I am working on a program that interfaces with a lab view program and used a very basic socket protocol to send and recive data. and i need to bypass the whole <policy-file-request/> bit when it comes to data sending and reciving. . How am i to do this?

my data sending code is:
<mx:Script>
<![CDATA[

[code]......

View 5 Replies

ActionScript 3.0 :: Xmlsocket And Policy-file-request?

Jun 20, 2008

I have a chat server written in Java listening on port 6000 and a client app(using an xmlsocket) in Flash 9. I get these <policy-file-request/>. I understand the purpose and I read the one solution about creating a server on port 843 and serving a master policy file but since I do not have total control over our hosting I cannot use port 843.I also tried replying to the request with "<cross-domain-policy><allow-access-from domain='*' to-ports='*'/></cross-domain-policy>" + "�" but nothing happens.The other really strange thing is that using Firefox the file request waits for the response and does nothing...but in IE7 the file request goes through then it continues to work even with no response, I can send/receive using the socket without problem.Does anyone know a good way to 'satisfy' the file request using the Java server listening on port 6000?

View 5 Replies

ActionScript 3.0 :: Policy File With Socket Connection?

Jan 6, 2011

I have 2 applications which I wrote in ActionScript 3.0 as client and C#.net as server. These are basic chat applications. Also I have a test website which is running under the same machine with chat server application.
 
Server application is listening 289 port, flash application connecting to server with domain and 289 port, it can talk with server during working on Flash. But when I put the flash in a html page, the socket connection is breaking after a while because of security reasons.
 
I know that is necessary to put a crossdomain.xml file on target website's root folder. The problem is here: Yes, there is a crossdomain.xml file like this:[URL]...

View 2 Replies

Getting Flash Socket Policy File To Work?

May 30, 2010

Basically I'm using Flash to connect to a Java server.Despite my Java application replying to the <policy-file-request/>, in the Flash debug log it lists (not sure about the order as there are lots):

Security Sandbox Violation *
Connection to 192.168.1.86:4049 halted
Warning: Timeout on

[code].....

View 1 Replies

Flash - Adobe Socket Policy File Server?

Jul 16, 2009

Has anyone been able to successfully implement a service to serve the required socket policy file to FlashPlayer?I am running the Python implementation of the service provided by Adobe at

[URL]

and using the following policy file:

<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
</cross-domain-policy>

[code]....

View 6 Replies

Java :: Binary Socket And Policy File In Flex

May 17, 2010

I'm trying to evaluate whether Flex can access binary sockets. Seems that there's a class calles Socket (flex.net package). The requirement is that Flex will connect to a server serving binary data. It will then subscribe to data and receive the feed which it will interpret and display as a chart. I've never worked with Flex, my experience lies with Java, so everything is new to me. So I'm trying to quickly set something simple up. The Java server expects the following:

DataInputStream in = .....
byte cmd = in.readByte();
int size = in.readByte();
byte[] buf = new byte[size];
in.readFully(buf);
[Code] .....

After that - EOFException happens on the server and that's it. So the question is, am I approaching whole streaming data issue wrong when it comes to Flex? Am I sending the policy file wrong? Unfortunately, I can't seem to find a good solid example of how to do it. It seems to me that Flex can do binary Client-Server application, but I personally lack some basic knowledge when doing it. I'm using Flex 3.5 in IntelliJ IDEA IDE.

View 1 Replies

Flex :: Policy File Check Closes Socket

Sep 27, 2011

I have created a flex app that uses sockets. I published the flex app in a web application that runs on glassfish server. Now from that flex app i create a socket connection to a C# server and start sending/receiving data.The problem is that after i create the socket connection to C# server the flex app first checks the policy file, and after it get's it, it closes the socket, without keep the connection alive.[code] Now after i create the connection and it gets the policy from server it closes this socket, so to be able to use this connection i have to call again [code]After i do this, i can use normally the connection

View 1 Replies

ActionScript 3.0 :: Binary Socket Policy File On Server

Jan 15, 2009

I am attempting to setup a binary socket connection between flash running on my desktop and a Rabbit RCM3800 Microcontroller providing the server on my home network, which has no file system and has a very basic http server on it. Due to limitations of the microC I cannot run Java/Perl/Python or any other server on it other than setting up a server using its own native Dynamic C language (essentially manually opening and controlling sockets in C). I am able to successfully connect to a socket on port 3333 of the server and transfer information between the server and the .swf file when it is the sandbox type "local-trusted" (while I'm debugging in Flash).

Because of this I'm fairly certain the code to setup the socket between the server and flash works fine. My problem occurs when I try to run the .swf file as "local-with-network" (such as running it after publishing on my desktop) or "remote" (accessing the .swf file when it is located on the server) and it then requires a socket policy server to host a socket policy file on the server. On my server I have code setup such that whenever a socket opens on port 843 or port 3333 (my data port) and sends a stream of raw data containing the request <policy-file-request/>, the server writes back in ASCII the below code and closes the socket.

Code:
Select all<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "[URL]">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>
[Code] .....

So for some reason flash times out while waiting for the socket policy file. I have tested sending the <policy-request-file/> over telnet, and have received the above policy file. I have also sniffed using wireshark and saw that my desktop sent the policy request and received the policy file. I am guessing that Flash times out because it is waiting for some kind of terminating character that states the end of the policy file, and to that end I have tried sending. Interestingly, instead of sending the policy file I have tried sending random data from the server to flash, and flash displayed the Warning: Ignoring policy file at (URL) due to incorrect syntax. Because I don't receive this warning when I send my policy file I don't think it is formatted incorrectly.

I have also tried using the below flash code to hold the socket request open indefinitely, but it also errors after 20seconds.
Code: Select allSecurity.loadPolicyFile("xmlsocket://192.168.1.59:843");
The .swf file will eventually reside on the server itself at 192.168.1.59/myProg.html. I have only tested the flash file remotely on the server a couple times, and in addition to the previous warnings/errors, I received the warning: SWF from (URL) may not connect to a socket in its own domain without a policy file.

View 1 Replies

ActionScript 3.0 :: Flex Socket Policy File Server?

Jul 16, 2009

Actionscript Socket Policy File Server Problems Has anyone been able to successfully implement a service to serve the required socket policy file to FlashPlayer?

[Code]...

View 1 Replies

Flex :: Preferred Socket Policy File Server Implementation?

Jan 22, 2010

I'm trying to get my Flash application to connect via socket to my server, so I need to set up a socket policy file server. It seems like there are various roll-your-own implementations floating around out there, but is there any kind of standard or best practice with what to use?

As an aside, it seems strange that Adobe imposes this restriction but doesn't make something readily available to support it.

View 2 Replies

ActionScript 3.0 :: Sockets, Security And Classes Policy-file-request/> Hell?

Feb 15, 2008

Last few months I experienced lot pain of due to Flash Player 9 version 3 (I thought that 9 is version no.).

Last thing is new socket policy files and all the new security "improvements". We finally forced sockets to works, to:[URL]..

[Code]...

How I can wrap socket class and avoid <policy-file-request/>?

View 14 Replies

ActionScript 2.0 :: Make A Policy File For A Socket Server Made On Java With A Client?

Dec 30, 2011

how to make a policy file for a socket server made on java with a client made on as2.

View 21 Replies

Php :: Check Where Is Located Flash File Sending Request?

Apr 5, 2012

I have a flash file that is located on my website and I have a php file wich gets requests from flash file every 5 minutes. I want to be shure that flash file wich is sending request is located on my website and not somewhere else. How can I do it. Is there anything in PHPs global variables?

View 2 Replies

Flash :: Connect To Socket Even Though Policy Allows It?

Dec 31, 2010

In my Flash app, I'm connecting to my server like this:

Security.loadPolicyFile("xmlsocket://example.com:12860");
socket = new Socket("example.com", 12869);
socket.writeByte(...);
socket.flush();

At port 12860 I'm running a socket policy server, which (according to this document) correctly serves up my policy like this:

[Code]...

I get no security warnings, which I used to get before the policy server was in place. Still, the connection to port 12869 doesn't work. It's made (I can see with Wireshark and on the server), but no data is sent by Flash. It might be worth knowing that the SWF itself is served from example.com as well.

View 1 Replies

Flash :: Player Skips Socket Policy On 843?

Oct 9, 2009

So, this is a copy of another post I made, but I get a sneaking suspicion I put the post in the wrong forum:[URL]..The summary:
 
The Socket class in flash player sometimes, for some users (across all sorts of OS and Browsers) will not ask for the policy file from port 843 first, but instead will go straight to the port of the outgoing request, which in this case is our game server, who doesn't really understand the request.
 
In every case so far the user *is* using the latest version of flash too, so it's not an issue without outdated policy methods, which would have been my first guess.For most people it works just fine, but I posted a log in the thread for one of the non-working players. It's pretty mysterious, and I haven't found a fix yet... though I'm going to experiment with some work arounds.

View 5 Replies

ActionScript 3.0 :: Socket Policy Files Via Port 80?

Jan 5, 2009

I'm trying to talk to a fully RESTful api of my own creation. The api is up and running but flash does not support PUT and DELETE, and does not recieve http status codes properly, plus a whole load of other issues with flashes anaemic http support.

To get around this I am trying to use as3httpclientlib. A 3rd party as3 http library, that uses socket connections to access the whole http protocol properly. It's a great library, unfortunately because it uses sockets flash requires implementation of the socket policy file, even though the access is all via port 80, the standard http port.

[URL]

This has given me a real headache. I can't implement the port 843 policy server as the documentation suggests because it's out of my ability level i feel. Also when the client is running it may be behind a corporate firewall that doesn't allow 843 access, so serving the policy file via the standard port seems the way forward. This is where I am stuck.

The policy file documentation says this shouldn't matter as if you cant access 843 because of your firewall you'll be unable to access non standard ports anyway, but I am accessing standard ports, only via sockets instead of URLLoader.

In the root of my server I have placed the following policy file:

Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>

[code]....

View 2 Replies

ActionScript 3.0 :: Socket Cross Domain Policy

Jan 15, 2009

I have created a socket server on port 6666 because port 843 is in use on my mac.So when flash player request "policy-file-request" I return to it the cross domain xml, but I keep getting the security error that "cannot load data from".[code]As you see I receive the cross domain from the socket server.But I don't understand why flash player doesn't accept that?xmlsocket.connect("localhost", "6666");Does anybody have any idea why it throws that error "cannot load data from" ?

View 0 Replies

Data Integration :: Socket Access Policy Under Vista?

Feb 10, 2009

for a long time I could easily make socket connections from my swf files tom simples java servers on various ports (swfs embeded from activex, for example). I used the simple python server policy file provided at this article to open the needed tcp ports to my flash applications.

[Code]...

View 3 Replies

Actionscript 3 :: Flash Socket Policy Files Requirement?

Nov 21, 2011

Last time I worked with flash sockets I knew that a policy file is required only if the swf file is embedded in a different domain from the one where the socket connection is about to be made. Did newer version of flash player changed this, so now they'll alk for a policy file no matter what?

View 1 Replies

Facebook :: Port 843 For Socket Policy Files - Often Are Users' Ports Closed?

Oct 28, 2011

I'm working on a Flash/Facebook game. My swf and socket server are on different domains, so I have to use a socket policy file. According to Adobe, they have "filed with IANA, the Internet Assigned Numbers Authority, to reserve port 843 for the purposes of serving socket policy files." Unfortunately, my server has port 843 closed. I asked my server guy to open the port. Here's his reply:

[quote]One of the points Matt mentioned is even if we open that particular port how would you ensure the scores of people accessing this game from their schools, libraries or even people internal to OurCompany will have connectivity on the port. Let me explain, in order for traffic to flow on port 843 from the browser to the smart fox server, the users ISP also has to allow for that traffic to pass outbound from the users browser. It is possible that several users would not be able to run it, is that risk acceptable ?[/quote]

How common is it for ISPs to block port 843? I assumed that, since this is an Adobe standard, that ISPs would now have it open by default. What's the scoop?

View 2 Replies

ActionScript 3.0 :: Error #2048 Socket Security Sanbox Error While Policy Server Is Working

Jun 9, 2011

I have an application that connects to a binary socket server running on port 2234. I use the python policy file server, which I downloaded from [URL], which runs on port 843. If the client app is trying to connect to a socket I can see that the server is receivng the request for a policy file and that it sends it to the client. However, in the client, I get a security sandbox error. How is this possible? And is it possible to check whether the client really received the policy file? BTW, here is my policy file:

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>

View 3 Replies

Actionscript 3 :: Sending Images Via Socket?

Feb 29, 2012

I'm trying to send an image via a socket in as3 between two AIR applications that I made. It works fine with small images, but with the bigger ones, it gives me this error: "Error #2044: Unhandled IOErrorEvent:.text=Error #2124: Loaded file is an unknown type.". It repeats it several times, so I thought that the image might be cut to smaller ones, is that right? And if it is right, how to restore it??

View 1 Replies

ActionScript 3.0 :: Sending Image Through Socket

Jan 15, 2009

I'm loading a small portion (rectangle), of a png file and extracting the ARGB (Alpha, Red, Green, Blue) values of the bitmapdata using C#. I then send this bytearray to the flash player (using sockets). The flash player receives this as a ByteArray. I then use LoadBytes but it gives me the error "unknown file type". I'm guessing that it could be because the data is not png encoded (I don't know how to do it), and loadBytes requires that.

View 6 Replies

ActionScript 3.0 :: XML Socket - Sending Video To Server

Feb 19, 2010

I'm working on a small school project, and I'm grabbing video from my webcam like this:

camera = Camera.getCamera();
if (camera == null) {
Security.showSettings(SecurityPanel.CAMERA);
} else {
camera.setMode(960, 600, 30, true);
camera.setQuality(0, 100);
outgoingVideo = new Video();
[Code] .....

And I would like to now send this video to a server I am connected to using an XMLSocket. Is this possible?

View 1 Replies

Actionscript 3.0 :: Socket Isn't Sending Any Data After The Connect?

Feb 24, 2009

I'm tring to write an instant messager implementation, but i got a problem with the initial socket connection.I need to send a GET request with some parameters to a server and it will reply with a seed number message server IP.

Code: Select allvar socket:Socket = new Socket("appmsg.gadu-gadu.pl", 80);
var response:String = new String;
var request:String = new String;[code]......

why the socket isn't sending any data after the connect,i also wrote a small pop3 client and it works fine.

View 1 Replies

ActionScript 3.0 :: Dispatching New Event Upon Sending Request To HTTPService

Jul 9, 2009

I've a Services class...which handles the HTTPService requests and responses and faults. Now I want to dispatch a new event whenever I send request to the server...so that I can take custom actions like showing some popup window or disabling certain components.

Here is my services class:
PHP Code:
package business{
import mx.controls.Alert;
import mx.managers.CursorManager;
import mx.rpc.AsyncToken;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
[Code] .....

The method doRequest calls the HTTPServices send method...so in this method, I want to dispatch a new event and handle it in the main application...

View 1 Replies

Actionscript :: Sending HTTP Request With Multiple Parameters Having Same Name

Dec 2, 2009

I need to send a HTTP request (and get XML response) from Flash that looks similar to following:

http://example.com/somepath?data=1&data=2&data=3

I.e. having several parameters that share same name, but have different values.

Until now I used following code to make HTTP requests:

var resp:XML = new XML();
resp.onLoad = function(success:Boolean) {/*...*/};
resp.ignoreWhite = true;

[Code].....

But in that case I am loosing ability to do POST requests.

View 4 Replies

ActionScript 3.0 :: Sending Request To Retrieve Text From Database

Nov 5, 2011

I have a problem with a flashpage I am developing. It sends a request to a database through a php-file and retrieve a text that I place in a textfield. The problem is that the swedish and other specialcharacters is shown in code format looking like this u00e4 . I know both my php-file and database is correct because I have used the same request with the same php-file and database in a android app and it works perfect.

PHP Code:
<?php
header("Content-type: text/html; charset=utf-8");
$con = mysql_connect("localhost","db","psw");
if(!$con) {
[Code] .....

View 8 Replies

ActionScript 3.0 :: Socket Connection - Sending Data Without Any Errors?

Mar 18, 2009

I use a socket connection to share data between flash and VB. I check the connection in VB and send a message when my flash is connected. My VB tool then sends the data continuesly (about every 40 milliseconds or slower) to flash. Works fine. Now I have to send some data back from flash to VB. I can send the data without any errors in Flash but it never arrives in VB.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved