OperatorFoundation / shapeshifter-dispatcher

Shapeshifter Dispatcher converts Pluggable Transports that implement the Go API from the Pluggable Transports 2.1 specification into proxies usable by applications. Several proxy modes are provided, including proxying of both TCP and UDP traffic.
https://OperatorFoundation.org/
MIT License
177 stars 28 forks source link

Support hostnames when specifying hosts #24

Open colthreepv opened 4 years ago

colthreepv commented 4 years ago

I would like to leverage hostname resolution to not have to write IP by hand in the command invocation.

At the moment doing this,

any service on port 3333:

docker run --rm -p 3333:8000 jwilder/whoami
Listening on :8000

server:

shapeshifter-dispatcher --server --state state_srv -transparent --transports obfs4 --orport 127.0.0.1:3333 --bindaddr obfs4-127.0.0.1:2222 -logLevel DEBUG -enableLogging

client:

shapeshifter-dispatcher --client --state state_cli -transparent -target 127.0.0.1:2222 -transports obfs4 -proxylistenaddr localhost:9443 -logLevel DEBUG -enableLogging -optionsFile obfs4.json

Testing tunnel:

curl localhost:9443
I'm da23b149f740

So it works, but replacing 127.0.0.1 with localhost breaks tunnelling in many parts.

Is there a single point where this could be added? I could provide a PR

colthreepv commented 4 years ago

Opened library issue on shapeshifter-ipc#1

ghost commented 3 years ago

It would be nice to see a go package which leverages resolvconf for dns resolution actually. So that the command just passes the string argument upon exec, and pushes the resolved name to the parameters as an 'interface{}' pointer.