Forward Proxy
is similar to App/Socks5
in that it is implemented as an application.
http_proxy
.HTTP
and HTTPS
.Custom Authentication
and Proxy-Authorization: Basic
.
Custom Authentication
: User can use the parsed Proxy-Authorization, HTTP headers, URI parameters, built-in variables, etc. for flexible authentication.Proxy-Authorization: Basic
: Standard basic proxy authentication. In this case, the account value and Password
from Account
are used as Username
and Password
for Basic authentication; Account Name
is ignored, but authentication conditions are not ignored.key1=value1&openresty=edge
, where openresty
is the account name, and Edge's HTTP Forward Proxy therefore supports the dynamic account keyword.The idea behind the design of the authentication condition is it's an arithmetic expression, e.g., x = y
. x
is the left argument, y
is the right argument, and =
is the operator.
concate
all left parameters when the operator is not presence/non-existence
.algorithm
on the concated left parameter to get the value of A
, perform an algorithm
on the concated right parameter to get the value of B
, and then compare whether A
and B
are equal or not.equal/unequal
, but are converted to number types before comparison. (String type comparison is not supported)left parameter
exists one by one.equal/unequal
, and then judge whether the left value includes the right value or not.action
is performed.Splice
all right parameters.left parameter
.Example 1:(HTTPS)
# https
CONNECT ifconfig.io:443 HTTP/1.1
Host: ifconfig.io:443
Proxy-Authorization: openresty=edge # 明文也可支持
Example 2:(HTTP)
# http
GET http://ifconfig.io HTTP/1.1
Host: ifconfig.io
arg1: value1
arg2: value2
arg3: value3
Proxy-Authorization: YjNCbGJuSmxjM1I1UFdWa1oyVT0= # base64编码后的openresty=edge
Example 3:(Basic)
# http
GET http://ifconfig.io HTTP/1.1
Host: ifconfig.io
Proxy-Authorization: Basic YjNCbGJuSmxjM1I1UFdWa1oyVT0= # base64编码后的openresty=edge