同步操作将从 fagongzi/gateway 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Gateway is a restful API gateway based on HTTP, which can be used as a unified API access layer.
A very detailed tutorial for beginners. Link
Below are video tutorials.
Basics:
Routing Configuration Tutorial:
JWT Plugin Configuration Tutorial:
Please make sure your Go version is 1.10 or above. Otherwise, undefined "math/rand".Shuffle error will occur when compiling. StackOverFlow Link
The following content requires reader some knowledge of Docker. You can refer to this book, or check out the official documentation。
Use docker pull fagongzi/gateway
command to download gateway Docker image.
docker run -d -p 9093:9093 -p 80:80 -p 9092:9092 fagongzi/gateway
initiates the container. 3 Ports are exposed:
80
Proxy's HTTP port, this port is for client access.
9092
APIServer's external GRPC port
9093
APIServer's external HTTP Restful port. Visit http://127.0.0.1:9093/ui/index.html
to access the web UI.
Running parameters can be set by the following environment varaibles. Configuration overrides default.
GW_PROXY_OPTS
All options in proxy --help
are supported.
API_SERVER_OPTS
All options in apiserver --help
are supported.
ETCD_OPTS
All options in etcd --help
are supported.
fagongzi/gateway
A quick start image, consisting of three components: etcd, proxy, apiserver, Only intended for quick start experience. Do not use in production.
fagongzi/proxy
proxy component, production ready
fagongzi/apiserver
apiserver component, production ready
Available Gateway Web UI Projects:
Gateway consists of proxy
and apiserver
.
Proxy is a component which provides service to clients. Proxy is a stateless node. Multiple proxies can be deployed to handle huge traffic. More.
ApiServer provides GRPC and Restful to manage metadata for users. ApiServer integrates official Web UI. More.
A server is a a real backend service. More.
Cluster consists of servers which provide the same service. A server is chosen to handle a specific request based on a load balance strategy. More.
API is a key concept of Gateway. We can manage external APIs in Gateway and their distribution rules, aggregation rules and URL matching rules. More.
Routing is a route strategy. Cookie, Querystring, Header and Path in HTTP Request dictate traffic distribution and traffic duplication to a specific cluster. Through this feature, AB test and online traffic divertion is achieved. More.
Open source is not easy. If this project is helpful to you, you can buy me a drink, thank you!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。