php - Can't connect Websocket when using vagrant envirionment -


i'm using vagrant box using puphpet, environment php 5.5 + ubuntu 12.04 + apache + mysql. vagrant vm ip: 192.168.11.11, local machine hosts points 192.168.11.11 reactphp.dev, , works.

and, i'm using code: https://github.com/muuknl/phprealtimechat test websocket.

then visit reactphp.dev in chrome browser, , start server script using: php bin/server.php, , after type in username got error:

websocket connection 'ws://192.168.11.11:2000/' failed: error in connection establishment: net::err_connection_timed_out

it works when changed websocket ip `ws://127.0.0.1:2000/', why not work if change vm's ip address?

it's been while haven't used puphpet, when had troubles connecting through port (minus port 22), i've had issue command sudo ufw disable in vagrant machine.

if uwf isn't managing firewall of vm, try sudo service iptables stop, or sudo iptables -f.

perhaps they've changed behavior since then, it's still try.

the ssh tunnel (over opened port 22) might allow access local port 2000, proxified over. actual port 2000 of vm might limited due firewall.

try it, , tell me if works. if not, i'll dig in deeper.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -