Open cavebeat opened 7 years ago
hm yeah I think that code comes from a pull request that was done before the Andrew updated the ws dependency version. try to get the commit before last and see if that works
works with https://github.com/AndrewBelt/hack.chat/commit/5ca90f990cacbb7c7ac7c6156929baabb5a3121c
git checkout 5ca90f990cacbb7c7ac7c6156929baabb5a3121c
ping @marzavec
ok but did you try it with e60ac6936547341c67afdfff327ac40f6da2273b with ws@1.1.1 ?
I tried it with every commit. I enter the username and it stays blank and when i send a text message, it says Server Disconnected error with the socket flush error in the terminal.
TypeError: socket._receiver.flush is not a function
Loaded config 'config.json' Started server on 0.0.0.0:6060
/home/prince/hack.chat/server.js:64 socket._receiver.flush(); ^
TypeError: socket._receiver.flush is not a function
at WebSocket.
I tried every commit, including the latest commit. It doesn't work. What to do?
The npm error log file says:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'start' ]
2 info using npm@5.7.1
3 info using node@v7.10.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle hack.chat@1.0.0~prestart: hack.chat@1.0.0
6 info lifecycle hack.chat@1.0.0~start: hack.chat@1.0.0
7 verbose lifecycle hack.chat@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle hack.chat@1.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/hom$9 verbose lifecycle hack.chat@1.0.0~start: CWD: /home/prince/hack.chat
10 silly lifecycle hack.chat@1.0.0~start: Args: [ '-c', 'node server.js' ]
11 silly lifecycle hack.chat@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle hack.chat@1.0.0~start: Failed to exec start script
13 verbose stack Error: hack.chat@1.0.0 start: node server.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.
@princenasario Cd into the directory where you have the server software, run the command:
npm list ws
If the output of npm is different than ws@1.1.1
then you need to remove ws and install version 1.1.1
However, that version of ws is old and slow (not to mention vulnerable to an upgrade header attack). The best recommendation I have is to not use the legacy version and instead use:
https://github.com/hack-chat/main
This is the current software running on https://hack.chat/, it uses version 5.0.0 of the ws library and has been proven stable with over 400 connections.
When i set the nickname and press enter, following error occurs.
any idea what went wrong? Or what is missing?