0.10.5 • Published 4 years ago
youkuohao-gateway v0.10.5
Youkuohao Gateway
Features
- HTTP(s)/WebScoket proxy
- DNS
- Service Registry
- Domain router settings and indexes
Protocols
- http(s)
- lanproxy
- redirect
- urlproxy(s)
- ws(s)
Docker Environments
Name | Type | Default Value | Description |
---|---|---|---|
ACME_PRODUCTION | boolean | false | ACME should use production mode |
NODE_ENV | string | development | production or development |
HTTPS_EMAIL | string | - | |
API_HOST | string | localhost | api host, for example: api.youkuohao.com |
DISABLE_DOCKER | boolean | false | if true, do not use docker |
ENABLE_WEBSOCKET | boolean | true | - |
TASK_LOOP_PER_MS | number | 5000 | Task loop gap |
Docker Service Example
docker service create --name youkuohao-gateway \
--mount type=bind,src=$PWD/,dst=/root/datadir \
--mount type=bind,src=$PWD/.url-cached,dst=/root/.url-cached \
--mount type=bind,src=$PWD/.npm-read,dst=/root/.npm-read \
--env 'MAIN_URL=https://cdn.jsdelivr.net/npm/youkuohao-gateway@0.10.4-alpha.9/build/release/index.js' \
--env 'ACME_PRODUCTION=true' \
--env 'HTTPS_EMAIL=heineiuo@gmail.com' \
--env 'API_HOST=api.youkuohao.com' \
--env 'TASK_LOOP_PER_MS=10000' \
--env 'DEBUG=true' \
--env 'DATA_DIR=/root/datadir' \
--network cms \
--limit-cpu 0.5 \
--publish 80:80 \
--publish 443:443 \
--publish 53:53/udp \
docker.pkg.github.com/heineiuo/node-universal-runtime/node-universal-runtime:0.1.0
Proxy Design Doc
About API host
Proxy use domain (instead of IP address) as API host, it enables client request different Proxy Server to only one domain.
If client want to request a specified server with IP address, for example: request proxy.com but specify IP address as 220.19.10.12
, the request can be:
curl -X GET 'http://proxy.com/v1/domain?ip=220.19.10.12'
In server side, if the server is not 220.19.10.12
(Because of DNS), it will start proxy and send a request to 220.19.10.12
, with host
header:
curl -X GET 'http://220.19.10.12/v1/domain' -H host:proxy.com
0.10.5
4 years ago
0.10.4
4 years ago
0.10.4-alpha.9
4 years ago
0.10.4-alpha.7
4 years ago
0.10.4-alpha.8
4 years ago
0.10.4-alpha.6
4 years ago
0.10.4-alpha.5
4 years ago
0.10.4-alpha.4
4 years ago
0.10.4-alpha.3
4 years ago
0.10.4-alpha.2
4 years ago
0.10.4-alpha.1
4 years ago
0.10.3
4 years ago
0.10.2
4 years ago
0.10.1
4 years ago