go-gost / x Goto Github PK
View Code? Open in Web Editor NEWExtended (may be experimental) features outside the main gost tree.
License: MIT License
Extended (may be experimental) features outside the main gost tree.
License: MIT License
App crashes when connector specified and dialer not specified
$ ./gost-linux-amd64-3.0.0-rc.0 -C configv3nodialer.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbc32db]
goroutine 1 [running]:
github.com/go-gost/x/config/parsing.ParseHop(0xc00053ea20)
/home/gerry/code/go-gost/x/config/parsing/chain.go:89 +0x3db
github.com/go-gost/x/config/parsing.ParseChain(0xc000635a10)
/home/gerry/code/go-gost/x/config/parsing/chain.go:46 +0x2a5
main.buildService(0xc000570420)
/home/gerry/code/go-gost/gost/cmd/gost/config.go:109 +0xd6d
main.main()
/home/gerry/code/go-gost/gost/cmd/gost/main.go:143 +0x7eb
configv3nodialer.yaml
services:
- name: socks-0
addr: ":1080"
handler:
type: socks5
chain: chain-0
chains:
- name: chain-0
hops:
- name: hop-0
nodes:
- name: node-0
addr: 127.0.0.1:9050
connector:
type: socks5
# dialer:
# type: tcp
Run
./gost-linux-amd64-3.0.0-rc.0 -C configv3nodialer.yaml
Do not crash in this case. I guess app should just use tcp dialer as default
I plan to utilize the x
package as a library. The implementation is expected to provide the result of a Dial
, specifically a net.Conn
, based on the authorized ClientID
. The new Dialer, however, will not perform an actual dial; instead, it will retrieve the net.Conn from a map[ClientID]net.Conn
For this purpose, I would need the ClientIDFromContext
method and the ClientID
type to be public. However, they are currently internal, as seen here: https://github.com/go-gost/x/blob/master/internal/ctx/value.go.
Could you provide public access to the ClientID
value from the context?
Hi, I'm using shadowsocks protcol in chain, when the both client side and server side is gost, got this error:
{"handler":"ss","kind":"handler","level":"error","listener":"tcp","local":"[2001:db8::x]:100x,"msg":"chacha20poly1305: message authentication failed","remote":"[2001:db8::x]:100x","service":"shadowsocks""}
After that, I tried to replace the server side from gost to shadowsocks-rust, got this error on shadowsocks-rust:
WARN tcp handshake failed. peer: [2001:db8::x]:100x, decrypt length failed
And when I replace both the client side and server side from gost to shadowsocks-rust, everythings fine. So I'm wondering is that something wrong with gost's shadowsocks support? Any help will be appreciated.
以及后续是否可能将这些协议的处理移动到 core 中,谢谢!
App crashes when using node with "direct" dialer and non "direct" connector
$ ./gost-linux-amd64-3.0.0-rc.0 -C configv3directcrash.yaml
{"handler":"socks5","kind":"service","level":"info","listener":"tcp","msg":"listening on [::]:1080/tcp","service":"socks-0","time":"…"}
{"handler":"socks5","kind":"handler","level":"info","listener":"tcp","local":"127.0.0.1:1080","msg":"127.0.0.1:39054 <> 127.0.0.1:1080","remote":"127.0.0.1:39054","service":"socks-0","time":"…"}
{"duration":3982118,"handler":"socks5","kind":"handler","level":"info","listener":"tcp","local":"127.0.0.1:1080","msg":"127.0.0.1:39054 >< 127.0.0.1:1080","remote":"127.0.0.1:39054","service":"socks-0","time":"…"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xc53973]
goroutine 81 [running]:
github.com/go-gost/x/connector/socks/v5.(*socks5Connector).Handshake(0xc00007ccc0, {0x1471650?, 0xc00007ccc0?}, {0x0, 0x0})
/home/gerry/code/go-gost/x/connector/socks/v5/connector.go:71 +0x73
github.com/go-gost/core/chain.(*Transport).Handshake(0xc00007cd20, {0x1478bf8, 0xc0006e4750}, {0x0?, 0x0?})
/home/gerry/code/go-gost/core/chain/transport.go:103 +0x19d
github.com/go-gost/x/chain.(*route).connect(0xc0006e5260, {0x1478bf8, 0xc0006e4750}, {0x1488cb0, 0xc0008263e8})
/home/gerry/code/go-gost/x/chain/route.go:158 +0x2db
github.com/go-gost/x/chain.(*route).Dial(0xc0006e5260, {0x1478bf8, 0xc0006e4750}, {0x1297d30, 0x3}, {0xc000412170, 0xa}, {0xc0000d0180, 0x3, 0x3})
/home/gerry/code/go-gost/x/chain/route.go:61 +0x15e
github.com/go-gost/core/chain.(*Router).dial(0xc0005f6100, {0x1478bf8, 0xc0006e4750}, {0x1297d30, 0x3}, {0xc000412170, 0xa})
/home/gerry/code/go-gost/core/chain/router.go:181 +0x58f
github.com/go-gost/core/chain.(*Router).Dial(0xc000412170?, {0x1478bf8, 0xc0006e4750}, {0x1297d30, 0x3}, {0xc000412170, 0xa})
/home/gerry/code/go-gost/core/chain/router.go:119 +0xee
github.com/go-gost/x/handler/socks/v5.(*socks5Handler).handleConnect(0xc0003a3f40, {0x1478bf8, 0xc0006e4750}, {0x1481a40, 0xc000378040}, {0x1297d30, 0x3}, {0xc000412170, 0xa}, {0x1488cb0, ...})
/home/gerry/code/go-gost/x/handler/socks/v5/connect.go:34 +0x3fe
github.com/go-gost/x/handler/socks/v5.(*socks5Handler).Handle(0xc0003a3f40, {0x1478bf8, 0xc0006e4750}, {0x1481a40, 0xc000378040}, {0xc00062c010?, 0xc0006e97b8?, 0xbc1893?})
/home/gerry/code/go-gost/x/handler/socks/v5/handler.go:102 +0x7b3
github.com/go-gost/x/service.(*defaultService).Serve.func1()
/home/gerry/code/go-gost/x/service/service.go:186 +0x534
created by github.com/go-gost/x/service.(*defaultService).Serve
/home/gerry/code/go-gost/x/service/service.go:162 +0x530
configv3directcrash.yaml
services:
- name: socks-0
addr: ":1080"
handler:
type: socks5
chain: chain-0
chains:
- name: chain-0
hops:
- name: hop-0
nodes:
- name: node-0
addr: 127.0.0.1:9050
connector:
type: socks5
dialer:
type: direct
Run gost
./gost-linux-amd64-3.0.0-rc.0 -C configv3directcrash.yaml
Make request
curl --socks5-hostname "127.0.0.1:1080" -v "https://ifconfig.me"
Node should return error, but do not crash app
Buy the way, name "direct" for dialer that do nothing is confusing (my first thought was that is same as "tcp"). May be consider renaming or alias it to "none"
Also I think "direct" connector should check that connection passed to it is nil or dummy and return error if not or may be just close whatever is passed
Socks5 connector always provides userpass auth method
This is not expected behavior and cause problems with some socks5 servers
Dante socks5 server select userpass over no auth and gost provide empty userpass
Run dante server in docker
docker run -d -p 127.0.0.1:1080:1080 wernight/dante
Configure gost
configv3dante.yaml
services:
- name: socks-0
addr: ":1082"
handler:
type: socks5
chain: chain-0
chains:
- name: chain-0
hops:
- name: hop-0
nodes:
- name: node-0
addr: 127.0.0.1:1080
connector:
type: socks5
dialer:
type: tcp
Run gost
./gost-linux-amd64-3.0.0-rc.0 -C configv3dante.yaml
Try request to dante directly
curl --socks5-hostname "127.0.0.1:1080" -v "https://ifconfig.me"
Try request to gost
curl --socks5-hostname "127.0.0.1:1082" -v "https://ifconfig.me"
You will see auth failure
in gost output
You can use wireshark to see problem in authentication detailly
Do not add userpass client auth method if auth not configured
在docker中如果使用相对路径会保存到/bin/文件夹,导致持久化失效,虽然可以挂载文件但并不优雅。
这里感觉新增路径参数或保存到读取的配置文件的路径为保存路径比较好
Line 73 in 46db848
我记得Obfs4和Obfs-simple的支持在v2还有的啊?是因为什么原因移除了吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.