I could connect websocket to the server on my local machine. But when i uploaded the file to a remote ubuntu server, it doesn't work any more.
Server side code(server.php):
$master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($master, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($master, "127.0.0.1", 80);
socket_listen($master, 20);
client side code:
<script type="text/javascript">
var host = "ws://127.0.0.1:80/server.php";
socket = new WebSocket(host);
</script>
I open the client page from chrome canary version 24, server side didn't get any accepted socket.
I changed the host to "ws://xx.xx.xx.xx:80/server.php" to the real IP address of the server, doesn't work. Also changed the server side socket_bind($master, "127.0.0.1", 80) to real ip, no luck either.
Any one can help me?
Thanks,
Jasmine