1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-17 17:44:30 +02:00
isfk e8167a8b79
update plugins version & remove replace (#2118)
* update memory registry plugins version & remove replace

* update plugins version & remove replace

Co-authored-by: 申法宽 <shenfakuan@163.com>
2021-02-05 09:09:25 +00:00
..
2021-01-20 21:01:10 +00:00
2021-01-20 21:01:10 +00:00
2021-01-20 21:01:10 +00:00
2021-01-20 21:01:10 +00:00
2020-12-26 15:32:45 +00:00

HTTP Proxy

This is a http proxy plugin which converts RPC to HTTP request

Overview

NewService returns a new http proxy. It acts as a micro service and proxies to a http backend. Routes are dynamically set e.g Foo.Bar routes to /foo/bar. The default backend is http:localhost:9090. Optionally specify the backend endpoint url or the router. Also choose to register specific endpoints.

Usage

service := NewService(
      micro.Name("greeter"),
      // Sets the default http endpoint
      http.WithBackend("http:localhost:10001"),
)

// Set fixed backend endpoints
// register an endpoint
http.RegisterEndpoint("Hello.World", "/helloworld")

service := NewService(
      micro.Name("greeter"),
      // Set the http endpoint
      http.WithBackend("http:localhost:10001"),
)