Skip to content

chenpkg/balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Used

$ git clone https://github.com/chenpkg/balancer.git
$ cd ./balancer
$ go build

run http test server

$ cd ./httptest
$ go run server.go 8080 8081 8082 8083

after run balancer

$ cd ..
$ ./balancer
Schema: http
Port: 8000
Health Check: true
Location:
        Route: /
        Proxy Pass: [http:https://127.0.0.1:8080 http:https://127.0.0.1:8081 http:https://127.0.0.1:8082 http:https://127.0.0.1:8083 http:https://127.0.0.1:8084]
        Mode: round-robin

        Route: /random
        Proxy Pass: [http:https://127.0.0.1:8082 http:https://127.0.0.1:8083 http:https://127.0.0.1:8084]
        Mode: random

and run http client

$ cd ./httptest
$ go run client.go
127.0.0.1:8080
127.0.0.1:8081