Message from @redd
Discord ID: 462138140975693824
that error just means it can't bind to the port. Everything else in your code looks fine to me.
You may run into another error that looks exactly like that - where a port like 8000 doesn't work. Just check there is nothing running on that port before using it
I think my first mistake was trying to do websockets on a shared hosting server.
you can use that
bind the websocket server to the HTTP server
which library are you using?
Was trying to follow some tutorial
```js
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
app.use(express.static(__dirname + '/bower_components'));
app.get('/', function(req, res,next) {
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(client) {
console.log('Client connected...');
client.on('join', function(data) {
console.log(data);
client.emit('messages', 'Hello from server');
});
});
server.listen(4200, function() {
console.log('Server running...');
}); ```
something like this?
I gtg in like 2 mins lol
Yeah something similar
now that's the server file right?
also i can pick up "tomorrow " if needed
yes
that is an example "app.js" or whatever you want to call it
here is the tutorial I took that example from
and i'd run "node app" from ssh?
if you were ssh'ing into your server, yes
redd ~$ node ./app
Server running...
pretty sure you don't need the `./` part tho
whatever works ¯\_(ツ)_/¯
and then what would be the client side url
if you are running it on your computer, `http://localhost:4200/`
now I'm stuck cause im on shared hosting
if you are running on a server, `http://<server ip>:4200/`
what do you mean by that?
like, through bluehost
i cant open ports and dont have access to 80 so I dont think i can do it
you can use any port
they have them all closed
?
open a support ticket
you are missing something
wait
do you have root access to the server?
dont think so
try `sudo node app`
then type your password
I really gtg