Node.js,, unity - doesnt work without ngrok?


Im developing a node app which involves a http server and a socket io server for interaction with unity game.
So the problem is, the only way i can connect from unity game to launched on c9 app is by using randomly granted address by ngrok http 8081
ws:// doesnt work at all
Any tips on this?
Code looks like that:

    var express = require('express');
    var app = express();
    var http = require('http').Server(app);


    var io = require('')(8081);

    var port = process.env.PORT || 80;

    http.listen(port, function(){



Can you try using ws:// (changing the port to 8081 in the URL), and see if that makes a difference? I’m not too familiar with the tools, but based on your code, it sounds like that might be the problem.


Sure man I did try a lot of stuff including playing with different ports and setups.
Again like i said, the url u provided is only working with temp address by ngrok. Im just not ready to throw 5usd for ngrok premium yet to have static address.:grinning:


What error do you get with ws:// Does this happen because of clickthrough page?


I dont think there are any clickthrough pages.
And i dont see any errors, this lib just prints “connecting” and then nothing.
Yeah its deprecated but it works on any other hosting and locally as well.