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

build brook wasm(WebAssembly) wssclient #1123

Open
likev opened this issue Jan 14, 2023 · 2 comments
Open

build brook wasm(WebAssembly) wssclient #1123

likev opened this issue Jan 14, 2023 · 2 comments

Comments

@likev
Copy link

likev commented Jan 14, 2023

Since brook is a cross-platform network tool designed for developers, I think we can build a brook wasm(WebAssembly) wssclient to make brook run in browsers, so that many other network tools such as curl and ssh can also run in browsers(using brook as proxy) to do a lot of thing(ftp, email, TELNET).

https://github.com/golang/go/wiki/WebAssembly
https://developer.mozilla.org/en-US/docs/WebAssembly
https://developer.mozilla.org/en-US/docs/Web/API/Worker
https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

@txthinking-bot
Copy link

Indeed, go can be compiled into wasm, but wasm (browser) does not seem to support transport layer APIs, such as bind and listen a address
by unknown

@likev
Copy link
Author

likev commented Jan 15, 2023

Indeed, go can be compiled into wasm, but wasm (browser) does not seem to support transport layer APIs, such as bind and listen a address by unknown

That's why we need a brook wasm wssclient to proxy tcp/udp on browser, we can make a bind/listen polyfill with Worker Channel Messaging API postMessage and Streams_API WritableStream.

This approach is theoretically possible and will open up many application scenarios, but on the other hand requires a lot of additional work.

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