[grpc-io] Re: Unable to connect to remote grpc server using InsecureChannelCredentials from local client

2019-01-08 Thread 'Srini Polavarapu' via grpc.io
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.


Re: [grpc-io] Servers in PHP?

2019-01-08 Thread ljjsimon
Hi,
swoole (http://php.net/manual/en/book.swoole.php) supports a HTTP/2 server. 
Please consider it.

在 2016年1月28日星期四 UTC+8上午10:14:54,Nicolas Noble写道:
>
> There are several problems with the idea of a gRPC server in PHP, and we 
> have no plans for that.
>
> Basically, the only way it would work, is if you run PHP "naked", without 
> its typical nginx or apache frontend. You can't serve a long-lived 
> streaming RPC from a PHP page using typical settings. The page will timeout 
> very quickly. You could theoretically restrict yourselves to server unary 
> RPCs only, or have an arbitrary duration on "streaming" RPCs, but that 
> wouldn't be "gRPC" anymore. And even then, there's no proper HTTP/2 support 
> in PHP at the moment. With the typical model of having a frontend that'll 
> forward the requests to PHP processes spawned on the fly, you wouldn't have 
> access to the full HTTP/2 stream, which is required to properly server gRPC 
> requests.
>
> For more on that, I invite you to research how to serve websockets from 
> PHP. Probably all of the solutions you'll find will be by running a naked 
> PHP process, without Apache. That isn't the typical way people want to use 
> PHP. So a gRPC server in PHP would be fairly useless as it'd require you to 
> run it in a very atypical deployment environment.
>
> On Wed, Jan 27, 2016 at 2:23 PM, 
> > wrote:
>
>> Hey all—
>>
>> It appears as of right now you can only create CLIENTS in PHP, but not 
>> servers. I was wondering what the technical blockers behind this were and 
>> if it's on the roadmap for a future release?
>>
>> Thanks!
>>
>> -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to grp...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/412dccb6-836e-4486-ab19-34701bec0562%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/568508ae-824b-4c50-a350-561e0d8c970f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.