I am writing a small game server using Java.
I use TooTallNate-Java-Websockets library to create my websocket server. Everything works when I run my server on localhost , I can connect to it from everywhere.However when I submit my app to Heroku , every time I try to establish a socket connection I get an error ECONNREFUSED (Connection refused).
Worth to mention , that when I am running my app with foreman which is supposed to emulate heroku environment , everything works as it should.
As a port for my websocket server I tried to use 8080 and many others in range between 5000 to 8000.
I can only guess what is going on there on heroku , as logs contain only basic info of http requests.
Please help , I am close to give up :(
EDIT
Here is what I have in my Proc file:
web: ./build/install/my-app/bin/my-app
UPDATE Created a simple abstraction app to showcase the problem: (Tested in foreman of course , and it works in local environment)
WebSocket connection to 'wss://test-websocket-yan.herokuapp.com:39773/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I am answering my own question to share how I've managed to connect to Java websocket server on Heroku.