Skip to content

Commit 5b42454

Browse files
Merge pull request #6 from fosrl/dev
Proxy Manager Rewrite
2 parents 79f8745 + f7a705e commit 5b42454

File tree

7 files changed

+259
-292
lines changed

7 files changed

+259
-292
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
newt
22
.DS_Store
3+
bin/

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ test:
1313
local:
1414
CGO_ENABLED=0 go build -o newt
1515

16-
all_arches:
17-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o newt_linux_arm64
18-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o newt_linux_amd64
19-
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o newt_darwin_arm64
20-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o newt_darwin_amd64
21-
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o newt_windows_amd64.exe
22-
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o newt_freebsd_amd64
23-
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -o newt_freebsd_arm64
16+
release:
17+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/newt_linux_arm64
18+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/newt_linux_amd64
19+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o bin/newt_darwin_arm64
20+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/newt_darwin_amd64
21+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o newt_windows_amd64.bin/exe
22+
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o bin/newt_freebsd_amd64
23+
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -o bin/newt_freebsd_arm64
2424

2525
clean:
2626
rm newt

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/google/btree v1.1.2 // indirect
1111
github.com/gorilla/websocket v1.5.3 // indirect
1212
golang.org/x/crypto v0.28.0 // indirect
13+
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
1314
golang.org/x/net v0.30.0 // indirect
1415
golang.org/x/sys v0.26.0 // indirect
1516
golang.org/x/time v0.7.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN
44
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
55
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
66
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
7+
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA=
8+
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
79
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
810
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
911
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=

main.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,6 @@ persistent_keepalive_interval=5`, fixKey(fmt.Sprintf("%s", privateKey)), fixKey(
455455
if len(targetData.Targets) > 0 {
456456
updateTargets(pm, "add", wgData.TunnelIP, "tcp", targetData)
457457
}
458-
459-
err = pm.Start()
460-
if err != nil {
461-
logger.Error("Failed to start proxy manager: %v", err)
462-
}
463458
})
464459

465460
client.RegisterHandler("newt/udp/add", func(msg websocket.WSMessage) {
@@ -480,11 +475,6 @@ persistent_keepalive_interval=5`, fixKey(fmt.Sprintf("%s", privateKey)), fixKey(
480475
if len(targetData.Targets) > 0 {
481476
updateTargets(pm, "add", wgData.TunnelIP, "udp", targetData)
482477
}
483-
484-
err = pm.Start()
485-
if err != nil {
486-
logger.Error("Failed to start proxy manager: %v", err)
487-
}
488478
})
489479

490480
client.RegisterHandler("newt/udp/remove", func(msg websocket.WSMessage) {

0 commit comments

Comments
 (0)