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

GRPC over WebRTC using WASM #10

Open
ghost opened this issue Nov 8, 2018 · 4 comments
Open

GRPC over WebRTC using WASM #10

ghost opened this issue Nov 8, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 8, 2018

there is a pure webrtc golang impl here:https://github.com/pions/webrtc

SO i was thinking its maybe possible to do GRPC over Webrtc.
This could then allow p2p style architecture.
it woudl be usable for server to server and server to browser, Or server to desktop client.
So sort of one network transport for everything and GRPC for everything.

what do you think ? I am not sure it will work but its a metetr of trying i suspect.

BTW was very easy to get going and everything works immediatly.
I make it all into a Makefile so no reliance on bash files:

LIB=github.com/dennwc/dom
LIB_FSPATH=${GOPATH}/src/$(LIB)

WASM_FILES="$(GOROOT)/misc/wasm"

GRPC=${LIB_FSPATH}/examples/grpc-over-ws

dep:
	go get -u github.com/dennwc/dom
	go install github.com/dennwc/dom/cmd/wasm-server

open:
	code ${LIB_FSPATH}

##


run:
	cd ${GOPATH}/src/github.com/dennwc/dom && wasm-server

run-ex-grpc:
	cd $(GRPC) && GOOS=js GOARCH=wasm go build -o client.wasm ./client.go
	cd $(GRPC) && cp ${WASM_FILES}/wasm_exec.js ./
	cd $(GRPC) && go run ./server.go

@dennwc
Copy link
Owner

dennwc commented Nov 8, 2018

Yes, I have plans to finish the WebRTC for WASM as soon as synchronous callbacks CL is merged.

Similar to the WebSocket API in this project, I planned to expose a single API that will use the project you mentioned on the host, and JS implementation in the browser (using build tags).

So definitely worth exploring :)

@ghost
Copy link
Author

ghost commented Nov 8, 2018

wow thats an amazing co-incidence. Sort of on the same path !

Yep thats exactly the approch i was thinking with the golang webrtc on the server.
For Fat Clients ( Desktop and Mobile), we can use webrtc golang there.

@dtel
Copy link

dtel commented Apr 17, 2019

wow thats an amazing co-incidence. Sort of on the same path !

Yep thats exactly the approch i was thinking with the golang webrtc on the server.
For Fat Clients ( Desktop and Mobile), we can use webrtc golang there.

Do you have a sample of using pion-webrtc on the server and grow on the client?

@dennwc
Copy link
Owner

dennwc commented Apr 17, 2019

I think it was nice as an experiment for this package, but pion-webrtc now supports wasm natively. They've done a great job, So I will probably remove the example completely, or will just leave a gRPC signaling and use their library.

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