Skip to content

build brook wasm(WebAssembly) wssclient #1123

Open

Description

@likev

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

Activity

  1. txthinking-bot commented on Jan 14, 2023

    @txthinking-bot

    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

  2. likev commented on Jan 15, 2023

    @likev
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions