[grpc-io] Re: Unable to connect to remote grpc server using InsecureChannelCredentials from local client
You may need to enable HTTP/2 in the NGINX config. gRPC uses HTTP/2. The proxy may be downgrading to HTTP/1.1 which a gRPC server doesn't support. On Wednesday, December 26, 2018 at 5:38:11 PM UTC-8, Gopalakrishna Hegde wrote: > > I tried that with no success. I experimented a bit and noticed that > 1. If I do not install nginx on that machine and run the grpc server then > everything works fine. > 2. If I install nginx then the grpc server is not reachable. Even if I > stop and disable nginx service using systemctl grpc server is not reachable. > > Is this something to do with Nginx? Latest Nginx supports forwarding grpc > requests using server block configuration but I am yet to try that option. > Trying to get grpc server working standalone. > > > On Wednesday, 26 December 2018 12:18:35 UTC+8, Gopalakrishna Hegde wrote: >> >> Hi, >> I have a grpc server running on Digital Ocean Droplet which has >> a public IP address. The grpc server is using Nodejs and is running on >> "localhost:50051". I am running C++ client on my local PC and >> using InsecureChannelCredentials() to create a channel to the remote grpc >> server running on the droplet. However, the client is not able to connect >> to the server and always gets Status Code 14 with "Connect failed" or >> "Socket closed" message. If both server and client run on my local PC then >> everything works fine. What could be the issue? Can't the client connect to >> remote server using InsecureChannelCredentials() as credentials? Really >> appreciate any help. Below is the code block for server and client. >> >> --- Server Side Nodejs code running on Digital ocean >> droplet-- >>var server = new grpc.Server(); >> const service_handlers = { >> Hello: HelloService, >> }; >> >> >> server.addService(service.TestServiceService, service_handlers); >> >> const server_uri = 'localhost:' + server_port; >> console.log(`Creating grpc server and binding to ${server_uri}`); >> var ret = server.bind(server_uri, >> grpc.ServerCredentials.createInsecure()); >> console.log(ret); >> >> - >> >> - Client side C++ code -- >> auto creds = grpc::InsecureChannelCredentials(); >> std::string server_addr_ = "> droplet>:50051"; >> stub_ = TestService::NewStub( >> grpc::CreateChannel(server_addr_, creds)); >> - >> >> Thanks, Gopal >> >> >> -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/90e86d6c-33b2-4ae3-991e-84e7f5b6c94d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[grpc-io] Re: Unable to connect to remote grpc server using InsecureChannelCredentials from local client
I tried that with no success. I experimented a bit and noticed that 1. If I do not install nginx on that machine and run the grpc server then everything works fine. 2. If I install nginx then the grpc server is not reachable. Even if I stop and disable nginx service using systemctl grpc server is not reachable. Is this something to do with Nginx? Latest Nginx supports forwarding grpc requests using server block configuration but I am yet to try that option. Trying to get grpc server working standalone. On Wednesday, 26 December 2018 12:18:35 UTC+8, Gopalakrishna Hegde wrote: > > Hi, > I have a grpc server running on Digital Ocean Droplet which has > a public IP address. The grpc server is using Nodejs and is running on > "localhost:50051". I am running C++ client on my local PC and > using InsecureChannelCredentials() to create a channel to the remote grpc > server running on the droplet. However, the client is not able to connect > to the server and always gets Status Code 14 with "Connect failed" or > "Socket closed" message. If both server and client run on my local PC then > everything works fine. What could be the issue? Can't the client connect to > remote server using InsecureChannelCredentials() as credentials? Really > appreciate any help. Below is the code block for server and client. > > --- Server Side Nodejs code running on Digital ocean > droplet-- >var server = new grpc.Server(); > const service_handlers = { > Hello: HelloService, > }; > > > server.addService(service.TestServiceService, service_handlers); > > const server_uri = 'localhost:' + server_port; > console.log(`Creating grpc server and binding to ${server_uri}`); > var ret = server.bind(server_uri, > grpc.ServerCredentials.createInsecure()); > console.log(ret); > > - > > - Client side C++ code -- > auto creds = grpc::InsecureChannelCredentials(); > std::string server_addr_ = " droplet>:50051"; > stub_ = TestService::NewStub( > grpc::CreateChannel(server_addr_, creds)); > - > > Thanks, Gopal > > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/367c7333-1bd7-49f8-94cb-5f48bb57cdb0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[grpc-io] Re: Unable to connect to remote grpc server using InsecureChannelCredentials from local client
Please note that I have a Nginx reverse-proxy server configured to run on the same Digital ocean droplet. On Wednesday, 26 December 2018 12:18:35 UTC+8, Gopalakrishna Hegde wrote: > > Hi, > I have a grpc server running on Digital Ocean Droplet which has > a public IP address. The grpc server is using Nodejs and is running on > "localhost:50051". I am running C++ client on my local PC and > using InsecureChannelCredentials() to create a channel to the remote grpc > server running on the droplet. However, the client is not able to connect > to the server and always gets Status Code 14 with "Connect failed" or > "Socket closed" message. If both server and client run on my local PC then > everything works fine. What could be the issue? Can't the client connect to > remote server using InsecureChannelCredentials() as credentials? Really > appreciate any help. Below is the code block for server and client. > > --- Server Side Nodejs code running on Digital ocean > droplet-- >var server = new grpc.Server(); > const service_handlers = { > Hello: HelloService, > }; > > > server.addService(service.TestServiceService, service_handlers); > > const server_uri = 'localhost:' + server_port; > console.log(`Creating grpc server and binding to ${server_uri}`); > var ret = server.bind(server_uri, > grpc.ServerCredentials.createInsecure()); > console.log(ret); > > - > > - Client side C++ code -- > auto creds = grpc::InsecureChannelCredentials(); > std::string server_addr_ = " droplet>:50051"; > stub_ = TestService::NewStub( > grpc::CreateChannel(server_addr_, creds)); > - > > Thanks, Gopal > > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/a027d7f1-37b2-4a9c-be45-3e38e1229191%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.