Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a possibility to handle The token has an invalid signature error on creating relayedServer #28

Open
andrei-rodionov-idexx opened this issue Mar 25, 2019 · 1 comment

Comments

@andrei-rodionov-idexx
Copy link

Actual Behavior

const RelayedServer = require('hyco-websocket').relayedServer;
const wsServer = new RelayedServer({
  server: ...,
  token: () => WebSocket.createRelayToken(...),
});

If token is invalid the following raw error appears in log at WebSocketClient.failHandshake (C:\Projects\IDEXX\CornerstoneCloud\infra\scripts\websocket-port-bridge\node_modules\hyco-websocket\node_modules\websocket\lib\WebSocketClient.js:339:32)

Expected Behavior

Should be able to handle this error in client code.
The issue is in HybridConnectionsWebSocketServer.js module (lines 258-260). Can we just add a line server.emit('error', event); in client.on('connectFailed'... event

Versions

  • OS platform and version: Microsoft Windows 8.1 Pro
  • Node Version: v10.9.0
  • NPM package version or commit ID: 1.0.5
@andrei-rodionov-idexx andrei-rodionov-idexx changed the title Add possibility to handle The token has an invalid signature error on creating relayedServer Add a possibility to handle The token has an invalid signature error on creating relayedServer Mar 25, 2019
@jfggdl
Copy link

jfggdl commented Oct 27, 2020

We will be planning for improvements to our SDKs and this item is already on our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants