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

Does this run inside a webcontainer? #11

Closed
davidoort opened this issue Jan 26, 2025 · 3 comments
Closed

Does this run inside a webcontainer? #11

davidoort opened this issue Jan 26, 2025 · 3 comments

Comments

@davidoort
Copy link

I'm wondering if I can run the client inside a proxy running in Stackblitz' webcontainers?

@boronine
Copy link
Owner

I'm not sure. Apparently webcontainers are implemented using WASM which is fine for JavaScript runtime but I have no idea how they implement native APIs, e.g. Node.js "tls" module 🤷

@davidoort
Copy link
Author

The issue I was running into when testing was the following:

TypeError: n.consume is not a function
    at ServerHttp2Session.setupHandle (builtins.ddb8d84d.js:122:11072)
    at new Http2Session (builtins.ddb8d84d.js:122:12905)
    at new ServerHttp2Session (builtins.ddb8d84d.js:122:16606)
    at Http2Server.connectionListener (builtins.ddb8d84d.js:122:32169)
    at Http2Server.emit (builtins.ddb8d84d.js:30:10899)
    at _0x1c34be.onconnection (builtins.ddb8d84d.js:285:13096)
    at blitz.1b4252dd.js:40:199554
    at _0x3d254e (blitz.1b4252dd.js:40:199668)
    at _0x1c34be.connectToClient (blitz.1b4252dd.js:40:1013429)
    at MessagePort._0x295eef (blitz.1b4252dd.js:19:299323)

which seems to point to an issue/limitation with node:http2. I guess this is strictly necessary for h2tunnel to work?

@boronine
Copy link
Owner

Thanks for posting the stack trace, that's useful. It seems that this runtime reimplements Node.js APIs on top of browser APIs which might be easy enough for fetch or simple HTTP servers but not practical for low-level networking APIs that h2tunnel requires. Furthermore it's proprietary so there's no way to look under the hood.

So I guess the answer to your question is sadly no, this runtime is not supported by h2tunnel :(

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