Giter Club home page Giter Club logo

grpc-test's Introduction

Sample gRPS project

Java - PHP communication

Install dependencies:

# binary packages
sudo apt-get install php7.0 php7.0-dev zlib1g-dev
sudo pecl install grpc
sudo apt-get install openssl

# composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

# protobuf compiller
git clone https://github.com/stanley-cheung/Protobuf-PHP
cd Protobuf-PHP
# don't forget to add pear directory to php include dir
# (add /usr/share/pear to /etc/php/php.ini)
rake pear:package version=1.0
sudo pear install Protobuf-1.0.tgz
cd ..
rm -rf Protobuf-PHP

Generate ssl certificates(optional):

# test sertificates are allready generated(password: test)
cd certificates
./generate # you can customize sertificate details in this file
cp * ../PHP/certificates/
cp * ../src/main/resources/

Build server:

cd PBuffTest
./gradlew jar

Build client:

cd PHP
composer install
./generate_protos # or just protoc-gen-php -i . -o . ./greeter.proto

Run server

java -jar build/libs/protobuff-0.0.1-SNAPSHOT.jar

Run client

cd PHP
php -d extension=grpc.so HelloClient.php YourName

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.