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

[bug] meekserver and meeklite transport error #38

Open PoneyClairDeLune opened 3 years ago

PoneyClairDeLune commented 3 years ago

Description

The meeklite (also meekserver) transport cannot be used due to errors in either parsing command or the JSON file. Other transports (e.g. obfs4) are fine.

Sorry for my poor knowledge in Go in advance.

Platform

Debian 11 for amd64 CPUs.

Error reproduction

checking for optionsFile LOG INFO initializing server transport listeners LOG INFO shapeshifter-dispatcher - initializing server transport listeners LOG ERROR Error resolving Extended OR address "missing port in address"

user@term $ ./shapeshifter-dispatcher \ -mode transparent-TCP -client -state state \ -target 127.0.0.1:80 -transport meeklite \ -optionsFile meek.json -proxylistenaddr 127.0.0.1:4443 \ -enableLogging -logLevel debug -ipcLogLevel DEBUG

checking for optionsFile LOG INFO shapeshifter-dispatcher - initializing client transport listeners LOG INFO meeklite - registered listener: 127.0.0.1:4443 LOG INFO shapeshifter-dispatcher - accepting connections Dialing 127.0.0.1:80 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x54a76a]

goroutine 5 [running]: net/url.(*URL).String(0x0, 0x0, 0x16) /usr/lib/go-1.15/src/net/url/url.go:813 +0x4a github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite/v2.Transport.Dial(0x0, 0x0, 0x0, 0x7ffd5903105a, 0xc, 0x927120, 0xbbacf0, 0xc000182410, 0xc0000282c0, 0x16, ...) ~/go/pkg/mod/github.com/!operator!foundation/shapeshifter-transports/transports/meeklite/v2@v2.2.8/meeklite.go:140 +0x2f github.com/OperatorFoundation/shapeshifter-dispatcher/modes/transparent_tcp.clientHandler(0x7ffe1855e05a, 0xc, 0x7ffe1855e072, 0x8, 0xc000130000, 0x46, 0x9326a0, 0xc000010010, 0x0) ../shapeshifter-dispatcher/modes/transparent_tcp/transparent_tcp.go:85 +0x1ac created by github.com/OperatorFoundation/shapeshifter-dispatcher/modes.clientAcceptLoop ../shapeshifter-dispatcher/modes/tcp_common.go:73 +0x2d4

* When the `meek.json` file is structured like this: `{"url":"https://entry.example.org/","front":"192.168.0.101"}`, running command ends up outputting errors like these:

user@term $ ./shapeshifter-dispatcher \ -mode transparent-TCP -server -state state \ -orport 127.0.0.1:80 -transport meekserver \ -optionsFile meek.json -bindaddr meekserver-127.0.0.1:4443 \ -enableLogging -logLevel debug -ipcLogLevel DEBUG

checking for optionsFile LOG INFO initializing server transport listeners LOG INFO shapeshifter-dispatcher - initializing server transport listeners LOG ERROR Error parsing options map "{\"url\":\"https://entry.example.org/\",\"front\":\"192.168.0.101\"}" "json: cannot unmarshal string into Go value of type map[string]interface {}" LOG ERROR TOR_PT_SERVER_TRANSPORT_OPTIONS: "{\"url\":\"https://entry.example.org/\",\"front\":\"192.168.0.101\"}": json: cannot unmarshal string into Go value of type map[string]interface {} LOG ERROR Error parsing bindaddrs "meekserver-127.0.0.1:4443" "{\"url\":\"https://entry.example.org/\",\"front\":\"192.168.0.101\"}" "meekserver"

user@term $ ./shapeshifter-dispatcher \ -mode transparent-TCP -client -state state \ -target 127.0.0.1:80 -transport meeklite \ -proxylistenaddr 127.0.0.1:4443 -optionsFile meek.json \ -enableLogging -logLevel debug -ipcLogLevel DEBUG

checking for optionsFile LOG INFO shapeshifter-dispatcher - initializing client transport listeners LOG INFO meeklite - registered listener: 127.0.0.1:4443 LOG INFO shapeshifter-dispatcher - accepting connections LOG ERROR Could not parse options meeklite options json decoding error -> Error creating a transport with the provided options: {"url":"https://entry.example.org/","front":"192.168.0.101"} -> Error: meeklite options json decoding error LOG ERROR Could not parse options meeklite options json decoding error -> Error creating a transport with the provided options: {"url":"https://entry.example.org/","front":"192.168.0.101"} -> Error: meeklite options json decoding error