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

Connect to server hosted on Heroku failed #29

Open
pampas93 opened this issue May 9, 2018 · 5 comments
Open

Connect to server hosted on Heroku failed #29

pampas93 opened this issue May 9, 2018 · 5 comments

Comments

@pampas93
Copy link

pampas93 commented May 9, 2018

I hosted a server on heroku (node.js) which emits time in intervals (testing). It works when I test on http://amritb.github.io/socketio-client-tool/ but fails to connect while I run from Unity. local servers connect and receive data, but fails to connect to the server hosted on heroku.

This is the URL: https://socket-unity.herokuapp.com/

Any issue or I must be doing something wrong

@floatinghotpot
Copy link
Owner

Tips: check the server port, and whether allowed by firewall.

@pampas93
Copy link
Author

pampas93 commented May 9, 2018

This is an online hosted server and connects when I tested on the socket.io client tool. This is my code,

socket = IO.Socket("https://socket-unity.herokuapp.com/");
socket.On(Socket.EVENT_CONNECT, () => {
        Debug.Log("Connected to server socket");
});

Is there any online hosted socket.io url that I can test with my Unity?

@floatinghotpot
Copy link
Owner

I see https://, but this plugin only support http so far.

@Zbluu
Copy link

Zbluu commented May 9, 2018

I used Heroku too, juste replace "https://socket-unity.herokuapp.com/" by ""ws://socket-unity.herokuapp.com/", it's work for me.
The first connection can also takes time if the server was in "sleeping mode", just wait for it to start.

@pampas93
Copy link
Author

pampas93 commented May 9, 2018

Perfect. It works like a charm. Thanks

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