AndrewBelt / hack.chat

a minimal, distraction-free chat application
https://hack.chat/
MIT License
2.39k stars 337 forks source link

Server not working | Upgrade Required #126

Closed 6f7a79 closed 7 years ago

6f7a79 commented 7 years ago

Client is up and working but the backend(js) is not working at all(username popup not & chat not working).

node --version
  v0.12.7

curl localhost:6060
  Upgrade Required

what version of node i can upgrade to ?

thanks,

AndrewBelt commented 7 years ago

The "Upgrade Required" message is what you see when you try to access a websocket path with an HTTP browser, has nothing to do with the Node version.

Open up the Network tab of the Web Inspector in Firefox or Chrome, and refresh the page. There may be an error for the Websocket URL when the client tries to open it. What does it say?

6f7a79 commented 7 years ago

hey, i made some network changes(nothing to do with the hack.chat) and now its working, anyway thanks for replying!

pwxcoo commented 7 years ago

i met same problem as u, could tell me more details about 'network changes'? thanks much!

pwxcoo commented 7 years ago

Debugging with inspector protocol because Node.js v8.4.0 was detected. node --inspect=12342 --debug-brk server.js Debugger listening on ws://127.0.0.1:12342/d43bbfa6-32a5-493f-b007-806f9a677eba Loaded config 'config.json' Started server on 127.0.0.1:6060

F:\hellowxc\node\mychat\hack.chat\client>http-server -p 6060 Starting up http-server, serving ./ Available on: http://192.168.1.105:6060 http://127.0.0.1:6060 Hit CTRL-C to stop the server

i'm confused...

raf924 commented 7 years ago

Started server on 127.0.0.1:6060

means the websocket server is starting on the port 6060. Hence the websocket created by the client will have to connect to that port.

Now that client is served by starting the http-server command on a port that must be different from the websocket server port.

For example:

http-server -p 8080

As Andrew said earlier, the "Uprade Required" message appears when the websocket server is accessed by a normal HTTP client (such as a browser via the url bar or via the software curl)

pwxcoo commented 7 years ago

Awesome Reply! thanks!