-
Notifications
You must be signed in to change notification settings - Fork 43
Callback issue on verifyConnection middleware #144
Comments
@svu-simpaltek this may be related to this issue #139 which could be in lower level websocket library. Also just to note your verify connection should not take too long to execute otherwise you may get |
the https request returns in milliseconds, so I do not think this is an issue. |
How do you connect from node client, can you share code from there. |
attached is the server and client nodejs app. This is what I used to test the user authentication. let me know if you need anything else. |
@svu-simpaltek Thanks for providing example, just run your code on Macbook and everything worked as expected (could be platform related issue what system are you running on?) if that is the case then problem most likely in the windows binding for uws. ClusterWS 3 uses old builds of uws. I am working on newer version which allow to do engine swap ws/cws (alpha version of ClusterWS 4 supports that you can try it out) |
I am on windows. Can you provide more clarity on how to use the new alpha version on switching the engine? |
You can follow https://clusterws.github.io/guide/server/ (this docs will be change with newer releases) if you search for |
got the beta version and set the engine like this: new ClusterWS({ However, I still get the same result: error: { Error: socket hang up Any other ideas to test? |
|
it should look like
also make sure to install ws module with |
I got it to work using the alpha version and ws engine. Thanks for your help. Do you have a timeframe in which the alpha version will be officially released? |
@svu-simpaltek after more research and tests i have started working on improved concept which will require more set up but gives move power to the user and reduces overhead. Also i am doing more benchmark and overall code improvements. This is VERY rough template on how it may look. Of cause more iterations will be made withing next few weeks. Also most likely version 4.0 will be released without ability to scale between multiple machines and will only support scale in single machine (multiple CPU cores). I can not say exact timelines as i am still testing different approaches and deciding between layouts. I think withing next few weeks i should have some more updates regarding this. |
In my verifyConnection code, I am calling an api, After the api returns, I try to set next(true) but connection is closed. I am testing a node server app to node client app.
my code:
function Worker() {
// Get websocket server
const wss = this.wss;
// Get http/https server
const server = this.server;
log error:
error: { Error: socket hang up
at createHangUpError (_http_client.js:323:15)
at Socket.socketOnEnd (_http_client.js:426:23)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19) code: 'ECONNRESET' }
disconnected
The text was updated successfully, but these errors were encountered: