You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I'm trying to connect to my instance with client.publicStreaming(), I'm getting this exception
Error: Unexpected server response: 301
at ClientRequest.<anonymous> (/data/node_modules/node-red-contrib-megalodon/node_modules/ws/lib/websocket.js:912:7)
at ClientRequest.emit (node:events:513:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:534:22)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
I was able to hack a solution in transpiled JS.
Two fixes were needed in my case.
Append / to /api/v1/streaming. This solved 301 redirect to /api/v1/streaming/. Not sure where this came from.
I also had to add .trim() in Streaming, as for some reason, space %20 was being added here. It may be a bug coming from my implementation in Node-RED. But it may be worth to add sanitization in the lib.
As I'm trying to connect to my instance with
client.publicStreaming()
, I'm getting this exceptionIt may be connected to a default nginx config that forces TLS?
I'm not sure how to debug this. I'm using a slightly modified streaming example from readme.
https://github.com/not7cd/node-red-contrib-megalodon/blob/fa9c3b49f51208cffb59d793108b79ab563de272/src/streaming.js
The text was updated successfully, but these errors were encountered: