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

trpc-go doesn't support gRPC protocol? #139

Closed
2 tasks
zanlichard opened this issue Nov 10, 2023 · 15 comments
Closed
2 tasks

trpc-go doesn't support gRPC protocol? #139

zanlichard opened this issue Nov 10, 2023 · 15 comments
Labels
question Further information is requested

Comments

@zanlichard
Copy link

Preliminary Research

  • I have read the project's documentation.
  • I have searched existing issues for similar questions to see if my question has already been addressed.

Question

Additional Information

@zanlichard zanlichard added the question Further information is requested label Nov 10, 2023
@WineChord
Copy link
Contributor

@zanlichard
Copy link
Author

if the protocol config option in trpc_go.yaml config use http and proto definition by protobuf,it means client access server by gRPC?

@WineChord
Copy link
Contributor

No, it is actually HTTP-RPC, refer to: https://github.com/trpc-group/trpc-go/tree/main/http

image

@zanlichard
Copy link
Author

if we use rpc over http, what's the format of the url path client accessing service ?

@zanlichard
Copy link
Author

trpc-go integrete grpc by codec in trpc-ecosystem,how to modify main.go?
like this _ "trpc.group/trpc-go/trpc-codec/grpc" in main.go?

@WineChord
Copy link
Contributor

if we use rpc over http, what's the format of the url path client accessing service ?

https://github.com/trpc-group/trpc-go/tree/main/http#custom-url-path

Something like http://ip:port/trpc.app.server.Greeter/SayHello.

@WineChord
Copy link
Contributor

trpc-go integrete grpc by codec in trpc-ecosystem,how to modify main.go? like this _ "trpc.group/trpc-go/trpc-codec/grpc" in main.go?

You may check the examples: https://github.com/trpc-ecosystem/go-codec/blob/main/grpc/examples/clients/grpc/main.go

@zanlichard
Copy link
Author

  1. register under base layer
    import "trpc.group/trpc-go/trpc-go/codec"
    codec.Register("grpc", &serverCodec{}, &clientCodec{})

  2. register implicitly
    add code into main.go as below
    import _ "trpc.group/trpc-go/trpc-codec/grpc"

  3. register explicitly
    add code into main.go,as below
    import "trpc.group/trpc-go/trpc-codec/grpc"
    s := trpc.NewServer(server.WithStreamTransport(grpc.DefaultServerStreamTransport))

@zanlichard
Copy link
Author

what's the difference between gRPC and tgprc?

@WineChord
Copy link
Contributor

The tRPC framework itself is an extremely flexible and plugin-based structure. tgrpc is the result of integrating the server/client capabilities of gRPC into the tRPC framework. By using tgrpc, you can leverage various plugin capabilities of tRPC server/client while also interacting with other gRPC server/clients.

@ninesunqian
Copy link

No, it is actually HTTP-RPC, refer to: https://github.com/trpc-group/trpc-go/tree/main/http

image

Does the pan-http rpc service support rpc-web client ? for example nice-rpc-web

@WineChord
Copy link
Contributor

"pan-http rpc service" is essentially HTTP service, not of trpc/grpc protocols. You may try to use tgrpc server examples: https://github.com/trpc-ecosystem/go-codec/blob/main/grpc/examples/servers/tgrpc/main.go

@ninesunqian
Copy link

"pan-http rpc service" is essentially HTTP service, not of trpc/grpc protocols. You may try to use tgrpc server examples: https://github.com/trpc-ecosystem/go-codec/blob/main/grpc/examples/servers/tgrpc/main.go

Does it have js client ?

@WineChord
Copy link
Contributor

You can assume it is served as a normal grpc service, any tool that is used to connect to grpc service can be used with it.

@ninesunqian
Copy link

You can assume it is served as a normal grpc service, any tool that is used to connect to grpc service can be used with it.

ok. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants