-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #449 from tobychui/v3.1.6
- Exposed log file, sys.uuid and static web server path to start flag - Optimized connection close implementation - Added toggle for uptime monitor - Added optional copy HTTP custom headers to websocket connection
- Loading branch information
Showing
27 changed files
with
3,363 additions
and
2,390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package dynamicproxy | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
"imuslab.com/zoraxy/mod/dynamicproxy/loadbalance" | ||
"imuslab.com/zoraxy/mod/dynamicproxy/rewrite" | ||
) | ||
|
||
/* | ||
Default Provider | ||
This script provide the default options for all datatype | ||
provided by dynamicproxy module | ||
*/ | ||
|
||
// GetDefaultAuthenticationProvider return a default authentication provider | ||
func GetDefaultAuthenticationProvider() *AuthenticationProvider { | ||
return &AuthenticationProvider{ | ||
AuthMethod: AuthMethodNone, | ||
BasicAuthCredentials: []*BasicAuthCredentials{}, | ||
BasicAuthExceptionRules: []*BasicAuthExceptionRule{}, | ||
BasicAuthGroupIDs: []string{}, | ||
AutheliaURL: "", | ||
UseHTTPS: false, | ||
} | ||
} | ||
|
||
// GetDefaultHeaderRewriteRules return a default header rewrite rules | ||
func GetDefaultHeaderRewriteRules() *HeaderRewriteRules { | ||
return &HeaderRewriteRules{ | ||
UserDefinedHeaders: []*rewrite.UserDefinedHeader{}, | ||
RequestHostOverwrite: "", | ||
HSTSMaxAge: 0, | ||
EnablePermissionPolicyHeader: false, | ||
PermissionPolicy: nil, | ||
DisableHopByHopHeaderRemoval: false, | ||
} | ||
} | ||
|
||
// GetDefaultProxyEndpoint return a default proxy endpoint | ||
func GetDefaultProxyEndpoint() ProxyEndpoint { | ||
randomPrefix := uuid.New().String() | ||
return ProxyEndpoint{ | ||
ProxyType: ProxyTypeHost, | ||
RootOrMatchingDomain: randomPrefix + ".internal", | ||
MatchingDomainAlias: []string{}, | ||
ActiveOrigins: []*loadbalance.Upstream{}, | ||
InactiveOrigins: []*loadbalance.Upstream{}, | ||
UseStickySession: false, | ||
UseActiveLoadBalance: false, | ||
Disabled: false, | ||
BypassGlobalTLS: false, | ||
VirtualDirectories: []*VirtualDirectoryEndpoint{}, | ||
HeaderRewriteRules: GetDefaultHeaderRewriteRules(), | ||
EnableWebsocketCustomHeaders: false, | ||
AuthenticationProvider: GetDefaultAuthenticationProvider(), | ||
RequireRateLimit: false, | ||
RateLimit: 0, | ||
DisableUptimeMonitor: false, | ||
AccessFilterUUID: "default", | ||
DefaultSiteOption: DefaultSite_InternalStaticWebServer, | ||
DefaultSiteValue: "", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.