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

slice bounds out of range [:16] with capacity 0 #41

Open certaintls opened 2 years ago

certaintls commented 2 years ago

When I followed the documentation to start the dispatcher with shadow, there was no error on the server side, after

./shapeshifter-dispatcher -transparent -server -state state -target 127.0.0.1:3333 -transports shadow -bindaddr shadow-127.0.0.1:2222 -optionsFile ConfigFiles/shadowServer.json -logLevel DEBUG -enableLogging
shadow listening on 127.0.0.1:2222

But, when I got error on the client side

./shapeshifter-dispatcher -transparent -client -state state -transports shadow -proxylistenaddr 127.0.0.1:9999 -optionsFile ConfigFiles/shadowClient.json -logLevel DEBUG -enableLogging
Dialing 
panic: runtime error: slice bounds out of range [:16] with capacity 0

goroutine 5 [running]:
github.com/OperatorFoundation/go-shadowsocks2/darkstar.getServerIdentifier({0xc00001a210?, 0xc000020100?}, 0x8ae)
    /go/pkg/mod/github.com/!operator!foundation/go-shadowsocks2@v1.1.7/darkstar/client.go:198 +0xca
github.com/OperatorFoundation/go-shadowsocks2/darkstar.NewDarkStarClient({0xc000020100?, 0x4?}, {0xc00001a210, 0xe}, 0x0?)
    /go/pkg/mod/github.com/!operator!foundation/go-shadowsocks2@v1.1.7/darkstar/client.go:36 +0xc5
github.com/OperatorFoundation/Shadow-go/shadow/v3.(*Transport).Dial(0xc0001801b0)
    /go/pkg/mod/github.com/!operator!foundation/!shadow-go/shadow/v3@v3.0.4/shadow.go:150 +0x9f
github.com/OperatorFoundation/shapeshifter-dispatcher/modes/transparent_tcp.clientHandler({0x7fff735232ac, 0x6}, {0xc0000fa000, 0x95}, {0x67ded0, 0xc000010010}, 0x640e30?)
    /workspaces/shapeshifter-dispatcher/modes/transparent_tcp/transparent_tcp.go:82 +0x1c7
created by github.com/OperatorFoundation/shapeshifter-dispatcher/modes.clientAcceptLoop
    /workspaces/shapeshifter-dispatcher/modes/tcp_common.go:73 +0x212

The error message doesn't tell the end user what is wrong.

consuelita commented 2 years ago

Hello, thank you for this, we are working on it.