You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by anubhav <an...@gmail.com> on 2013/05/10 10:50:35 UTC

websocket protocol access from remote computer


I have designed a chat application based on websocket protocol.

i have installed a xampp server in computer A .I start the server in
computer A and then I am trying to access client.php page (url is
ipadresssofA/project/client.php) from computer B using the ip address of
computer A. But it is displaying socket error.

And when i try same url on computer A (url is
ipadresssofA/project/client.php). client get connects.BOTH COMPUTERS ARE
CONNECTED WITH SAME WIFI. Here is my client code.please tell me what is
wrong

<html>
<head>






</head>
<body onload="initialize()">
 <center>
 <div id="chatlog"></div>
 <input id="msg" type="textbox" onkeypress="onkey(event)"/>
 <button onclick="send()">Send</button>
 <button onclick="quit()">Stop</button>
 <div id="userslog"></div>
 </center>
</body>
</html>

Also in my server code something is written in comments which i want to show
you :

// start the server
$Server = new PHPWebSocket();
$Server->bind('message', 'wsOnMessage');
$Server->bind('open', 'wsOnOpen');
$Server->bind('close', 'wsOnClose');
// for other computers to connect, you will probably need to change this to
your LAN IP or external IP,
// alternatively use: gethostbyaddr(gethostbyname($_SERVER['SERVER_NAME']))
$Server->wsStartServer('localhost', 12345);

Please telll where i am wrong



--
View this message in context: http://activemq.2283324.n4.nabble.com/websocket-protocol-access-from-remote-computer-tp4666878.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: websocket protocol access from remote computer

Posted by Michael Black <md...@yahoo.com>.
This is probably not the forum you want as this doesn't sound like it has
anything to do with ActiveMQ.

Check your firewall settings.
And check if you bound the socket to localhost or the IP address of your
machine.  You want to bind the socket to your IP address.

-----Original Message-----
From: anubhav [mailto:anubhavjhalani09@gmail.com] 
Sent: Friday, May 10, 2013 3:51 AM
To: users@activemq.apache.org
Subject: websocket protocol access from remote computer



I have designed a chat application based on websocket protocol.

i have installed a xampp server in computer A .I start the server in
computer A and then I am trying to access client.php page (url is
ipadresssofA/project/client.php) from computer B using the ip address of
computer A. But it is displaying socket error.

And when i try same url on computer A (url is
ipadresssofA/project/client.php). client get connects.BOTH COMPUTERS ARE
CONNECTED WITH SAME WIFI. Here is my client code.please tell me what is
wrong

<html>
<head>






</head>
<body onload="initialize()">
 <center>
 <div id="chatlog"></div>
 <input id="msg" type="textbox" onkeypress="onkey(event)"/>
 <button onclick="send()">Send</button>
 <button onclick="quit()">Stop</button>
 <div id="userslog"></div>
 </center>
</body>
</html>

Also in my server code something is written in comments which i want to show
you :

// start the server
$Server = new PHPWebSocket();
$Server->bind('message', 'wsOnMessage');
$Server->bind('open', 'wsOnOpen');
$Server->bind('close', 'wsOnClose');
// for other computers to connect, you will probably need to change this to
your LAN IP or external IP,
// alternatively use: gethostbyaddr(gethostbyname($_SERVER['SERVER_NAME']))
$Server->wsStartServer('localhost', 12345);

Please telll where i am wrong



--
View this message in context:
http://activemq.2283324.n4.nabble.com/websocket-protocol-access-from-remote-
computer-tp4666878.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.