Skip to content

Conversation

@exaV
Copy link

@exaV exaV commented Dec 27, 2023

See #49

We no longer throw an error if we connect to IP address while a
ALLOWED_DEST_FQDN is set, instead we check that the destination IP address matches the pattern. This is the simplest possible change that allows users to restrict which IP addresses can be connected to. A more elaborate change would be to introduce a new environment variable that reflects that both IP addresses and domain names can be restricted. I don't mind either solution.

@bobpaul
Copy link

bobpaul commented Mar 9, 2025

When I checkout the commit before this, it builds fine. When I checkout this commit, I get

$ CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s' -o ./socks5
# github.com/serjs/socks5-server
./ruleset.go:23:29: invalid operation: req.DestAddr.FQDN != nil (mismatched types string and untyped nil)
./ruleset.go:24:62: invalid operation: cannot indirect req.DestAddr.FQDN (variable of type string)
./ruleset.go:26:62: invalid operation: cannot indirect req.DestAddr.IP (variable of type net.I

ALLOWED_DEST_FQDN can also match IP if FQDN is not defined
@exaV
Copy link
Author

exaV commented Mar 11, 2025

@bobpaul I fixed the compilation error. Thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants