Git Product home page Git Product logo

grpc-cgi-proxy's Introduction

gRPC CGI Proxy

gRPC CGI Proxy 是 gRPC 透明代理解决方案.

gRPC CGI Proxy

Running

go run main.go

在服务启动前,请先确保下列依赖服务已经在本地安装且可以正常访问:

动态路由支持

当前使用静态配置文件指定下游服务,后续可以通过 控制面 动态配置服务路由:

[
    {
      "service_name": "go_wallet_manage_svr",
      "namespace": "Production",
      "desc": "钱包服务",
      "methods": [
        {
          "cgi_path": "/cgi-proxy/create_wallet",
          "method": "GET",
          "desc": "创建钱包",
          "cmd": "CreateWallet",
          "timeout": 1000
        },
        {
          "cgi_path": "/cgi-proxy/import_wallet",
          "method": "POST",
          "desc": "导入钱包",
          "cmd": "ImportWallet",
          "timeout": 1000
        }
      ]
    }
]

接口测试用例

curl --location --request POST 'http://127.0.0.1:8081/cgi-proxy/import_wallet' \
--header 'Content-Type: application/json' \
--data '{
    "private_key": "0x01c4bda0939df07a31e3738c6c1e1d5905c9f229e6ffa1922557308a62efb23f"
}'
curl --location --request POST 'http://127.0.0.1:8081/cgi-proxy/import_wallet' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'private_key=0xf1feee1a38a42bc46fd05bebcc0fa17d6b35446349863e01c8db4c65603f3725'

License

This project is licensed under the Apache 2.0 license.

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.