Closed yovanoc closed 3 years ago
I think I know the culprit. Fixing now. Thanks for reporting, I really appreciate it! <3
Basically new URL('https://google.com/httpbin.org:443').pathname
gives /httpbin.org:443
instead of httpbin.org:443. Which results in an invalid CONNECT path. Node.js should fix that.
Fixed. Please let me know if it works or not :)
Ahah perfect now ! Big thanks ! When these agents will be available to work with Got ?
I have now to make websockets working with http2 I think it will be harder :/
If we put the h2-over-h1 agent on engine.io-client options, I think it could work. Waiting the release of these agents. Big thanks
tested and of course: TypeError [ERR_INVALID_ARG_TYPE]: The "options.agent" property must be one of Agent-like Object, undefined, or false. Received an instance of m
i will have to use raw websocket then implements engine.io on top on my own
i will have to use raw websocket then implements engine.io on top on my own
Well, you aren't alone, I will create an example on how to do this too :) That's quite common use-case.
Really you can do this? :0 Because I really don’t know how to do this .. I have to connect to a primus server with engine.io as transport behind http2 and it’s not easy
No, I will just create an example on how to use the ws
package with http2-wrapper
.
Oh right ! Good don’t have questions anymore :)
I've done more polishing, will create a ws
example tomorrow.
Waw amazing bro! So we will be able to use proxy through http2-wrapper for the ws?
Theoretically (based on https://github.com/jasnell/http2ws/blob/master/http2ws.js) this should work 536e0786659e307688b59a9ae8edb7ab7b8000e7 but I wasn't able to find any HTTP/2 server that would support WebSockets, so couldn't test it.
The proxies should work now. Closing. Don't hesitate to ask any questions if you have any :)
Hello, yes I try again and I got
CONNECTED!
RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear
at Receiver.getInfo (/Users/devchris/Library/Mobile Documents/com~apple~CloudDocs/Documents/code/nodejs/http2-wrapper/node_modules/ws/lib/receiver.js:171:14)
at Receiver.startLoop (/Users/devchris/Library/Mobile Documents/com~apple~CloudDocs/Documents/code/nodejs/http2-wrapper/node_modules/ws/lib/receiver.js:131:22)
at Receiver._write (/Users/devchris/Library/Mobile Documents/com~apple~CloudDocs/Documents/code/nodejs/http2-wrapper/node_modules/ws/lib/receiver.js:78:10)
at writeOrBuffer (_stream_writable.js:352:12)
at Receiver.Writable.write (_stream_writable.js:303:10)
at ClientHttp2Stream.socketOnData (/Users/devchris/Library/Mobile Documents/com~apple~CloudDocs/Documents/code/nodejs/http2-wrapper/node_modules/ws/lib/websocket.js:900:35)
at ClientHttp2Stream.emit (events.js:315:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:284:9)
at ClientHttp2Stream.Readable.push (_stream_readable.js:223:10) {
[Symbol(status-code)]: 1002
}
DISCONNECTED!
@yovanoc Can you please open another issue for this?
@yovanoc I've fixed the WebSockets POC. PTAL.
Hello, I checked and still the issue :/
Follow up on #43
curl -XPOST -v "https://httpbin.org/anything" --proxy "http://username:password@ip:port" --http2
Result: https://gist.github.com/yovanoc/e316e8f3e965a1a2b7e1d29de76ff92c
H2 over H1 is working with curl but not here, maybe the proxy url starting with http and not https?