Skip to content

Commit

Permalink
fix: reenable indeependent nat for vpn server
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Aug 3, 2024
1 parent 56ceaa9 commit 0e3d3a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/admin_service_commander.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func startTunnelRequest(opt ConfigOptions, installService bool) (bool, error) {
Ipv6: opt.IPv6Mode == option.DomainStrategy(dns.DomainStrategyUseIPv4),
ServerPort: int32(opt.InboundOptions.MixedPort),
StrictRoute: opt.InboundOptions.StrictRoute,
EndpointIndependentNat: false,
EndpointIndependentNat: true,
Stack: opt.InboundOptions.TUNStack,
})
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions v2/tunnel_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (

func (s *TunnelService) Start(ctx context.Context, in *pb.TunnelStartRequest) (*pb.TunnelResponse, error) {
if in.ServerPort == 0 {
in.ServerPort = 2334
in.ServerPort = 12334
}
useFlutterBridge = false
res, err := Start(&pb.StartRequest{
ConfigContent: makeTunnelConfig(in.Ipv6, in.ServerPort, in.StrictRoute, in.EndpointIndependentNat, in.Stack),
EnableOldCommandServer: false,
DisableMemoryLimit: false,
DisableMemoryLimit: true,
EnableRawConfig: true,
})
fmt.Printf("Start Result: %+v\n", res)
Expand Down Expand Up @@ -49,7 +49,6 @@ func makeTunnelConfig(Ipv6 bool, ServerPort int32, StrictRoute bool, EndpointInd
"interface_name": "HiddifyTunnel",
"inet4_address": "172.19.0.1/30",
` + ipv6 + `
"mtu": 1492,
"auto_route": true,
"strict_route": ` + fmt.Sprintf("%t", StrictRoute) + `,
"endpoint_independent_nat": ` + fmt.Sprintf("%t", EndpointIndependentNat) + `,
Expand Down

0 comments on commit 0e3d3a0

Please sign in to comment.