Jump to content

Flash fails to connect to PHP Socket when Online!!!


reapermedia

Recommended Posts

AAAAAAAAAAAAAAAH!!!! I'm literally pulling my hair out here , i have followed this tutorial:

 

http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm

 

...to the letter after installing Apache and PHP on my pc. And i am geting really fraustrated because i cannot get the flash objects to connect to the PHP socket when they have been uploaded to the localhost server or any other online server. However it works no problem when i run the flash object straight from my HD. The socket is definately open because telnet connects to it fine.

 

My pc ip is 192.168.1.7. And when I transfer the flash object to any other pc on my lan, if it is on the hd, it connects to my pc no problem. However, if i were to type in http://192.168.1.7/socket_test.swf, it DOESN'T WORK!!!

 

Please help me

Link to comment
Share on other sites

thats not your IP thats your subnet ip, you need to find out your network's IP and change the flash app to connect to THAT IP.. also, you need to portforward whatever port you're using to connecty to your computer.. make that port forward to your subnet ip so that the router doesn't dismiss the request due to not knowing where to point the client :)

 

 

Link to comment
Share on other sites

Now, just to let you know, I'm only using this for testing purposes so I can test the functionality of php ports in an application I'm developing. Do I still need to do this if I only want to get it to work on my pc. I don't want to have any access to it from outside the network. If I only want to get it to work on my network, or just my own pc, how would I go about getting it to work. Do I still have to do everything you said. And how would I go about doing what you said, in easy to understand terms?

 

Cheers

Reaper

Link to comment
Share on other sites

Btw, I reviewed that tutorial, and I found a problem. Because that's an old tutorial this problem wouldn't have occurred when it was made, but now it will.

 

Within the PHP server where a new client is added "array_push($read_sockets, $client)", you'll have to send flash a response telling it that it's a legit response. As a measure of security this was added in like Flash 9.x.

 

After that line add:

 

socket_write($client, '<?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cross-domain-policy>' . chr(0x00));

 

I don't believe this is related to your direct problem posted in this thread, but you would encounter it next.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.