فهرست منبع

auto update script executed

Toby Chui 1 سال پیش
والد
کامیت
be9cad5b94

+ 2 - 0
mod/dynamicproxy/proxyRequestHandler.go

@@ -57,6 +57,7 @@ func (router *Router) rewriteURL(rooturl string, requestURL string) string {
 // Handle subdomain request
 func (h *ProxyHandler) subdomainRequest(w http.ResponseWriter, r *http.Request, target *ProxyEndpoint) {
 	r.Header.Set("X-Forwarded-Host", r.Host)
+	r.Header.Set("X-Forwarded-Server", "zoraxy-"+h.Parent.Option.HostUUID)
 	requestURL := r.URL.String()
 	if r.Header["Upgrade"] != nil && strings.ToLower(r.Header["Upgrade"][0]) == "websocket" {
 		//Handle WebSocket request. Forward the custom Upgrade header and rewrite origin
@@ -116,6 +117,7 @@ func (h *ProxyHandler) proxyRequest(w http.ResponseWriter, r *http.Request, targ
 	r.URL, _ = url.Parse(rewriteURL)
 
 	r.Header.Set("X-Forwarded-Host", r.Host)
+	r.Header.Set("X-Forwarded-Server", "zoraxy-"+h.Parent.Option.HostUUID)
 	if r.Header["Upgrade"] != nil && strings.ToLower(r.Header["Upgrade"][0]) == "websocket" {
 		//Handle WebSocket request. Forward the custom Upgrade header and rewrite origin
 		r.Header.Set("A-Upgrade", "websocket")

+ 1 - 0
mod/dynamicproxy/typedef.go

@@ -22,6 +22,7 @@ type ProxyHandler struct {
 }
 
 type RouterOption struct {
+	HostUUID           string
 	Port               int
 	UseTls             bool
 	ForceHttpsRedirect bool

+ 16 - 0
mod/sshprox/embed.go

@@ -0,0 +1,16 @@
+//go:build (windows && amd64) || (linux && mipsle) || (linux && riscv64)
+// +build windows,amd64 linux,mipsle linux,riscv64
+
+package sshprox
+
+import "embed"
+
+/*
+	Bianry embedding
+
+	Make sure when compile, gotty binary exists in static.gotty
+*/
+var (
+	//go:embed gotty/LICENSE
+	gotty embed.FS
+)

+ 18 - 0
mod/sshprox/embed_linux_386.go

@@ -0,0 +1,18 @@
+//go:build linux && 386
+// +build linux,386
+
+package sshprox
+
+import "embed"
+
+/*
+	Bianry embedding for i386 builds
+
+	Make sure when compile, gotty binary exists in static.gotty
+*/
+var (
+	//go:embed gotty/gotty_linux_386
+	//go:embed gotty/.gotty
+	//go:embed gotty/LICENSE
+	gotty embed.FS
+)

+ 18 - 0
mod/sshprox/embed_linux_amd64.go

@@ -0,0 +1,18 @@
+//go:build linux && amd64
+// +build linux,amd64
+
+package sshprox
+
+import "embed"
+
+/*
+	Bianry embedding for AMD64 builds
+
+	Make sure when compile, gotty binary exists in static.gotty
+*/
+var (
+	//go:embed gotty/gotty_linux_amd64
+	//go:embed gotty/.gotty
+	//go:embed gotty/LICENSE
+	gotty embed.FS
+)

+ 18 - 0
mod/sshprox/embed_linux_arm.go

@@ -0,0 +1,18 @@
+//go:build linux && arm
+// +build linux,arm
+
+package sshprox
+
+import "embed"
+
+/*
+	Bianry embedding for ARM(v6/7) builds
+
+	Make sure when compile, gotty binary exists in static.gotty
+*/
+var (
+	//go:embed gotty/gotty_linux_arm
+	//go:embed gotty/.gotty
+	//go:embed gotty/LICENSE
+	gotty embed.FS
+)

+ 18 - 0
mod/sshprox/embed_linux_arm64.go

@@ -0,0 +1,18 @@
+//go:build linux && arm64
+// +build linux,arm64
+
+package sshprox
+
+import "embed"
+
+/*
+	Bianry embedding for ARM64 builds
+
+	Make sure when compile, gotty binary exists in static.gotty
+*/
+var (
+	//go:embed gotty/gotty_linux_arm64
+	//go:embed gotty/.gotty
+	//go:embed gotty/LICENSE
+	gotty embed.FS
+)

+ 0 - 11
mod/sshprox/sshprox.go

@@ -1,7 +1,6 @@
 package sshprox
 
 import (
-	"embed"
 	"errors"
 	"fmt"
 	"log"
@@ -28,16 +27,6 @@ import (
 	online ssh terminal
 */
 
-/*
-Bianry embedding
-
-Make sure when compile, gotty binary exists in static.gotty
-*/
-var (
-	//go:embed gotty/*
-	gotty embed.FS
-)
-
 type Manager struct {
 	StartingPort int
 	Instances    []*Instance

+ 0 - 0
web/img/public/bg.png → res/bg.png


+ 0 - 0
web/img/public/bg2.png → res/bg2.png


+ 1 - 0
reverseproxy.go

@@ -47,6 +47,7 @@ func ReverseProxtInit() {
 	}
 
 	dprouter, err := dynamicproxy.NewDynamicProxy(dynamicproxy.RouterOption{
+		HostUUID:           nodeUUID,
 		Port:               inboundPort,
 		UseTls:             useTls,
 		ForceHttpsRedirect: forceHttpsRedirect,

BIN
web/img/public/bg.jpg


BIN
web/img/public/bg2.jpg


+ 1 - 1
web/login.html

@@ -23,7 +23,7 @@
             width: 100%;
             opacity: 0.8;
             z-index: -99;
-            background-image: url("img/public/bg.png");
+            background-image: url("img/public/bg.jpg");
             background-size: auto 100%;
             background-position: right top;
             background-repeat: no-repeat;

+ 1 - 1
web/reset.html

@@ -23,7 +23,7 @@
             width: 100%;
             opacity: 0.8;
             z-index: -99;
-            background-image: url("img/public/bg2.png");
+            background-image: url("img/public/bg2.jpg");
             background-size: auto 100%;
             background-position: right top;
             background-repeat: no-repeat;