Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket connection to 'ws://127.0.0.1:9000/' failed: Connection closed before receiving a handshake response #91

Open
setni opened this issue Feb 12, 2017 · 4 comments

Comments

@setni
Copy link

setni commented Feb 12, 2017

Hello,

I'm trying to create a web socket with your library.

With the exemple client.html,

  1. I started the socket : php -q testwebsock.php And receive Master socket: Resource id How to access uri parts #6
  2. I launch a localhost server php -S localhost:8080
  3. I access to localhost:8080/client.html

In the js console, I receive this message:
WebSocket connection to 'ws://127.0.0.1:9000/echobot' failed: Connection closed before receiving a handshake response

The issue is on firefox and chrome (up-to-date)
I'm using OSX 10.12.2

The direct command websocket = new WebSocket('ws://echo.websocket.org'); worked fine

Thanks in advance

@Xaraknid
Copy link
Collaborator

Did you open your firewall?

@rxpande
Copy link

rxpande commented Jul 5, 2017

Me too facing same issue ?

Any leads on this ?

@Xaraknid
Copy link
Collaborator

you open the websocket port on server 8080 and then you try to connect with the client on port 9000. Modify the client to reflect your server port

@hanita0o0
Copy link

woww I have problem that I did not how to run web socket , in your post you explain we should both
1- I started the socket : php -q testwebsock.php And receive Master socket: Resource id How to access uri parts #6
2-I launch a localhost server php -S localhost:8080
thanks very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants