Skip to content

neophack/GatewayAuthPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gateway Auth Pro

Go / React / Material-ui 网关登录工具

GitHub go.mod Go version GitHub repo size



Run

Download the version of the corresponding system

$ wget https://github.com/neophack/GatewayAuthPro/releases/download/v1.0.0/GatewayAuthPro_linux_amd64_1_0_0

$ chmod +x GatewayAuthPro_linux_amd64_1_0_0

$ ./GatewayAuthPro_darwin_amd64_1_0_0 -h
Usage of ./GatewayAuthPro_darwin_amd64_1_0_0:
  -c string
    	--c config file path / 配置文件路径 (default "./config")
    	
$ echo -e '[base]\nport = 8094\nproxySort=["test"]\n[proxy]\n    [proxy.test]\n    path = "/"\n    target = "http://127.0.0.1:80"\n    httpAuth = ["tom"]\n[auth]\n    [auth.test]\n    account = "test"\n    password = "123"' > ./config

$ ./GatewayAuthPro_darwin_amd64_1_0_0 -c ./config
2021/11/01 16:13:16 {"Base":{"Port":8094,"ProxySort":["test","serverstatusws","serverstatus"]},"Proxy":{"serverstatus":{"Path":"/","Target":"http://127.0.0.1:35601","CacheMaxAge":0,"HttpAuth":["tom"],"WsAuth":null},"serverstatusws":{"Path":"/public","Target":"http://127.0.0.1:35601","CacheMaxAge":0,"HttpAuth":null,"WsAuth":["tom"]},"test":{"Path":"/test","Target":"http://127.0.0.1:80","CacheMaxAge":0,"HttpAuth":["tom"],"WsAuth":["tom"]}},"Auth":{"test":{"Account":"test","Password":"123"},"tom":{"Account":"tom","Password":"123"}}}
2021/11/01 16:13:16 listen : 8094

Config File

[base]     
port = 8094
# proxy execution order / 代理执行顺序
proxySort=["test","serverstatusws","serverstatus"] 
crt = server.crt
key = server.key

[proxy]

    [proxy.test]
    path = "/test"
    target = "http://127.0.0.1:80"
    httpAuth = ["tom"]   # login account / 登录账号
    wsAuth = ["tom"]     # login account / 登录账号

    [proxy.serverstatusws]
    path = "/public"
    target = "http://127.0.0.1:35601"
    wsAuth = ["tom"]

    [proxy.serverstatus]
    path = "/"
    target = "http://127.0.0.1:35601"
    httpAuth = ["tom"]

[auth]
    
    # account and password / 账号密码
    [auth.tom]
    account = "tom"
    password = "123"

    [auth.test]
    account = "test"
    password = "123"

https

openssl genrsa -out server.key 2048
openssl req -nodes -new -key server.key -subj "/CN=localhost" -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

Link

LambdaExpression/GatewayAuth

About

golang reverse proxy http2https auth

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages