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

Fail to change port to 80 #32

Open
DaniloFeng opened this issue Dec 25, 2016 · 5 comments
Open

Fail to change port to 80 #32

DaniloFeng opened this issue Dec 25, 2016 · 5 comments

Comments

@DaniloFeng
Copy link

Firstly, my congratulations for the library! It's best way to get rid of MQTT and use socket.io everywhere.

I used your example in localhost with port 3484 and works fine.
But my cloud server don't accept other port to listen.

I changed both in your app.js and Hello_Time_ESP8266.ino the number of port to 80 and the ESP connect and disconnect sequentially.

[readHandshake] Connected. SID=o6lx5IknVIMyIdcLAAAw
[readHandshake] Websocket failed.[monitor] Can't connect. Aborting.
[monitor] Client not connected.

Do you have suggestions to solve this problem?

@washo4evr
Copy link
Owner

Hey,
Thank you for your message
just to be sure, you have to change the port in 3 different locations, depending on how you use it:
app.js
Hello.ino
index.html

also, could it be firewall / router related?
is your cloud server hosted locally or remote?

@DaniloFeng
Copy link
Author

Thank you for your attention and for responding quickly.

Initially, I did trying in localhost and in test with socket.io tester the server is working fine.

The port I use the same to .ino and app.js, and the stranger that in the tests only on port 80, 8080, 8000 and others popular ports don't work.

Probably some firewall, etc., but i have many servers with socket.io and none gave this kind of problem.

My Cloud Server is basied with OpenShift and don't have a possible to change the port.

For my project don't stop, I used the WebSocketClient library and altered my cloud server to ws module. And works well!

I did try to use the Chrome Console URL (http://youraddress.com/socket.io/?EIO=3&transport=websocket) and in the socket.io tester works fine, but on the ESP8266 connect when receiving the first message it disconnects.

@washo4evr
Copy link
Owner

Hi,
glad to see your made it work

as for the chrome console, I never used it I think
I usually rely on wireshark wwhen Im debugging / working on the library

@JasXSL
Copy link

JasXSL commented Jan 17, 2018

I'm having the same issue. Connecting via IP works fine. I can also connect through a browser with io('http://mydomain.com'); including socket.io from a CDN. It also worked fine to connect from a raspberry pi using only the socket.io client library.

But when I try to specify host as my domain, it won't connect. Using ESP32

@JasXSL
Copy link

JasXSL commented Jan 17, 2018

Found the issue. Leave out http:// and it'll work.

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

3 participants