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

multi sub protocol #387

Open
SabinoSisto opened this issue Jul 6, 2020 · 5 comments
Open

multi sub protocol #387

SabinoSisto opened this issue Jul 6, 2020 · 5 comments

Comments

@SabinoSisto
Copy link

this is my client call:

var client = new W3CWebSocket('ws://localhost:8080/TEST', ['ocpp1.6','ocpp1.5']);

into server side:
var connection = request.accept(['ocpp1.6','ocpp1.5'], request.origin);

error:
TypeError: acceptedProtocol.toLocaleLowerCase is not a function
at WebSocketRequest.accept (c:\Personale\Siti\eRiparto\node_modules\websocket\lib\WebSocketRequest.js:257:70)
at WebSocketServer. (c:\Personale\Siti\eRiparto\app.js:53:30)
at WebSocketServer.emit (events.js:314:20)
at WebSocketServer.handleUpgrade (c:\Personale\Siti\eRiparto\node_modules\websocket\lib\WebSocketServer.js:217:14)
at Server.emit (events.js:314:20)
at onParserExecuteCommon (_http_server.js:640:14)
at onParserExecute (_http_server.js:573:3)
at HTTPParser.callbackTrampoline (internal/async_hooks.js:123:14)

@ibc
Copy link
Collaborator

ibc commented Jul 6, 2020

Why are you passing an array of strings instead of a single string? Where did you read that in the docs?

@SabinoSisto
Copy link
Author

i want accept protocol ocpp1.6 or ocpp1.5
in server side how must define?

@SabinoSisto
Copy link
Author

in client i change :
var client = new W3CWebSocket('ws://localhost:8080/PROVA', 'ocpp1.6');

in server i changed:
var connection = request.accept('ocpp1.6,ocpp1.5', request.origin);

this is new error:
Error: Illegal character " " in subprotocol.

@SabinoSisto
Copy link
Author

News for me?

@SabinoSisto
Copy link
Author

i must accept protocol ocpp1.6 OR ocpp1.5
can you send me code to connection?
Thank's

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

No branches or pull requests

2 participants