https://github.com/vicanso/upstream
proxy upstream
https://github.com/vicanso/upstream
http ping upstream
Last synced: about 1 month ago
JSON representation
proxy upstream
- Host: GitHub
- URL: https://github.com/vicanso/upstream
- Owner: vicanso
- License: apache-2.0
- Created: 2019-02-13T12:53:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T12:24:55.000Z (over 2 years ago)
- Last Synced: 2024-12-27T19:44:31.625Z (10 months ago)
- Topics: http, ping, upstream
- Language: Go
- Size: 42 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# upstream
[](https://github.com/upstream/elton/actions)
It's easy to get upstream from upstream list. It support http request check or tcp port check.
```go
uh := upstream.HTTP{
// use http request check
Ping: "/ping",
}
uh.OnStatus(func(status int32, upstream *upstream.HTTPUpstream) {
})
uh.Add("http://127.0.0.1:7001")
uh.AddBackup("http://127.0.0.1:7002")
// do health check
uh.DoHealthCheck()
// do health check loop(default interval: 5s )
go uh.StartHealthCheck()
// get valid upstream by round robin
upstream := uh.PolicyRoundRobin()
```