Code Monkey home page Code Monkey logo

kgrpc-envoy's Introduction

kgrpc-envoy

A vanilla grpc servier in Kotlin and an envoy grpc-JSON/HTTP transcoder which allows a RESTful JSON API client to send requests to Envoy over HTTP and get proxied to a gRPC service

Description

A Kotlin simple grpc server which could handle both REST and gRPC request thanks to the grpc-json-transcoder

  • maven
  • docker
  • kotlin
  • envoy
  • protoc
  • googleapis

Table of Contents

Installation

run the server

  • mvn clean package
  • java -jar target/kgrpc-0.1.1-jar-with-dependencies.jar

run the envoy

  • docker build . -t kgrpc-envoy
  • docker run --publish 9901:9901 --publish 51051:51051 --rm kgrpc-envoy

Usage

gRPC side

grpcurl --plaintext -d '{str: abceisaname}' localhost:50051 com.knitehias.grpc.strlen.StrLenService/Len

REST side

curl -X GET -v -H "Content-Type: application/json" localhost:51051/v1/len/abceisaname

Kotlin gRPC Server

The little Kotlin gRPC server will return the length of the inputing string.

Envoy gRPC-JSON/HTTP Transcoder

A Kotlin simple grpc server which could handle both REST and gRPC request thanks to the grpc-json-transcoder

Google API

googleapis

Trivial

envoy admin

  • curl -X POST http://localhost:9901/clusters

  • curl -X POST http://localhost:9901/logging?connection=debug

Docker run network

I want to connect from a container to a service on the host
The host has a changing IP address, or none if you have no network access. We recommend that you connect to the special DNS name host.docker.internal which resolves to the internal >IP address used by the host. This is for development purpose and does not work in a production environment outside of Docker Desktop.
You can also reach the gateway using gateway.docker.internal.

kgrpc-envoy's People

Contributors

kooltuoehias avatar

Watchers

 avatar

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.