redpanda-data / connect

Fancy stream processing made operationally mundane
https://docs.redpanda.com/redpanda-connect/about/
8.14k stars 840 forks source link

swap github.com/gorilla/websocket out to allow building golang wasm gui #988

Open gedw99 opened 2 years ago

gedw99 commented 2 years ago

I dont know if this is something that interests you but this is useful for me.

This is required in order to build a golang client for benthos in golang using wasm.

There is a working example here: https://git.sr.ht/~whereswaldon/pointstar It a gioui golang client and a standard golang server. It does not use benthos, but does use https://github.com/nhooyr/websocket to show the golang server and golang client communicating. Its very easy to use.

The client is compiled to wasm ( for web ) and native ( for Desktop and Mobile). For example on desktop you can run the client with just "go run ." and it all just works. For compiling to Web or Mobile you use this: https://github.com/gioui/gio/tree/main/cmd/gogio

Jeffail commented 2 years ago

Hey @gedw99, in v4 the idea is that components are separate imports, so you'll be able to import alternative implementations at build time. This would enable leaner builds and swapping out certain capabilities and I'm assuming it'd also solve this issue.

What would the outcome of this particular issue be?

gedw99 commented 2 years ago

@Jeffail ah yeah i remember you mentioning that.. Its a great idea.

But https://github.com/Jeffail/benthos/search?q=github.com%2Fgorilla%2Fwebsocket is used in the core it seems ? If so then it wont help.

https://pkg.go.dev/nhooyr.io/websocket?tab=importedby is used by some battle tested projects btw. Its no toy.

name dropping follows :)

github.com/hashicorp/boundary/ https://pkg.go.dev/github.com/improbable-eng/grpc-web/go/grpcweb