add hop
This commit is contained in:
parent
2c29028a3b
commit
5d797eac43
@ -358,7 +358,7 @@ func buildServiceConfig(url *url.URL) (*config.ServiceConfig, error) {
|
||||
}
|
||||
for i, addr := range strings.Split(remotes, ",") {
|
||||
svc.Forwarder.Nodes = append(svc.Forwarder.Nodes,
|
||||
&config.NodeConfig{
|
||||
&config.ForwardNodeConfig{
|
||||
Name: fmt.Sprintf("target-%d", i),
|
||||
Addr: addr,
|
||||
})
|
||||
|
@ -92,7 +92,17 @@ func buildService(cfg *config.Config) (services []service.Service) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, hopCfg := range cfg.Hops {
|
||||
hop, err := parsing.ParseHop(hopCfg)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if hop != nil {
|
||||
if err := registry.HopRegistry().Register(hopCfg.Name, hop); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, chainCfg := range cfg.Chains {
|
||||
c, err := parsing.ParseChain(chainCfg)
|
||||
if err != nil {
|
||||
|
@ -1,5 +1,5 @@
|
||||
package main
|
||||
|
||||
const (
|
||||
version = "3.0.0-beta.5"
|
||||
version = "3.0.0-beta.6"
|
||||
)
|
||||
|
4
go.mod
4
go.mod
@ -5,8 +5,8 @@ go 1.18
|
||||
replace github.com/templexxx/cpu v0.0.7 => github.com/templexxx/cpu v0.0.10-0.20211111114238-98168dcec14a
|
||||
|
||||
require (
|
||||
github.com/go-gost/core v0.0.0-20220914115321-50d443049f3b
|
||||
github.com/go-gost/x v0.0.0-20220914120035-01d7dc77c67a
|
||||
github.com/go-gost/core v0.0.0-20220920034830-41ff9835a66d
|
||||
github.com/go-gost/x v0.0.0-20220922104515-cf20abf6568b
|
||||
)
|
||||
|
||||
require (
|
||||
|
8
go.sum
8
go.sum
@ -98,8 +98,8 @@ github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gost/core v0.0.0-20220914115321-50d443049f3b h1:fWUPYFp0W/6GEhL0wrURGPQN2AQHhf4IZKiALJJOJh8=
|
||||
github.com/go-gost/core v0.0.0-20220914115321-50d443049f3b/go.mod h1:bHVbCS9da6XtKNYMkMUVcck5UqDDUkyC37erVfs4GXQ=
|
||||
github.com/go-gost/core v0.0.0-20220920034830-41ff9835a66d h1:UFn21xIJgWE/te12rzQA7Ymwbo+MaxOcp38K41L+Yck=
|
||||
github.com/go-gost/core v0.0.0-20220920034830-41ff9835a66d/go.mod h1:bHVbCS9da6XtKNYMkMUVcck5UqDDUkyC37erVfs4GXQ=
|
||||
github.com/go-gost/gosocks4 v0.0.1 h1:+k1sec8HlELuQV7rWftIkmy8UijzUt2I6t+iMPlGB2s=
|
||||
github.com/go-gost/gosocks4 v0.0.1/go.mod h1:3B6L47HbU/qugDg4JnoFPHgJXE43Inz8Bah1QaN9qCc=
|
||||
github.com/go-gost/gosocks5 v0.3.1-0.20211109033403-d894d75b7f09 h1:A95M6UWcfZgOuJkQ7QLfG0Hs5peWIUSysCDNz4pfe04=
|
||||
@ -108,8 +108,8 @@ github.com/go-gost/relay v0.1.1-0.20211123134818-8ef7fd81ffd7 h1:itaaJhQJ19kUXEB
|
||||
github.com/go-gost/relay v0.1.1-0.20211123134818-8ef7fd81ffd7/go.mod h1:lcX+23LCQ3khIeASBo+tJ/WbwXFO32/N5YN6ucuYTG8=
|
||||
github.com/go-gost/tls-dissector v0.0.2-0.20220408131628-aac992c27451 h1:xj8gUZGYO3nb5+6Bjw9+tsFkA9sYynrOvDvvC4uDV2I=
|
||||
github.com/go-gost/tls-dissector v0.0.2-0.20220408131628-aac992c27451/go.mod h1:/9QfdewqmHdaE362Hv5nDaSWLx3pCmtD870d6GaquXs=
|
||||
github.com/go-gost/x v0.0.0-20220914120035-01d7dc77c67a h1:eq3whATyaFYmwTb4LspCOlIvWT5PFZlzPm+ZMZxTBCU=
|
||||
github.com/go-gost/x v0.0.0-20220914120035-01d7dc77c67a/go.mod h1:jILEGMQKVQDNGVbPqV985vv+/x9xYUbXSOkYP8ynjsU=
|
||||
github.com/go-gost/x v0.0.0-20220922104515-cf20abf6568b h1:eJ7H2Nkee589pX7/9umjJyFHe4cZmUbCr031TcMkxOY=
|
||||
github.com/go-gost/x v0.0.0-20220922104515-cf20abf6568b/go.mod h1:jILEGMQKVQDNGVbPqV985vv+/x9xYUbXSOkYP8ynjsU=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
|
33
gost.yml
33
gost.yml
@ -50,6 +50,7 @@ chains:
|
||||
failTimeout: 30s
|
||||
hops:
|
||||
- name: hop-0
|
||||
- name: hop-1
|
||||
interface: 192.168.1.2
|
||||
selector:
|
||||
strategy: rand
|
||||
@ -80,6 +81,38 @@ chains:
|
||||
metadata:
|
||||
bar: baz
|
||||
|
||||
hops:
|
||||
- name: hop-0
|
||||
interface: 192.168.1.2
|
||||
selector:
|
||||
strategy: rand
|
||||
maxFails: 3
|
||||
failTimeout: 60s
|
||||
bypass: bypass-0
|
||||
nodes:
|
||||
- name: node-0
|
||||
addr: ":1080"
|
||||
interface: eth1
|
||||
bypass: bypass-0
|
||||
connector:
|
||||
type: socks5
|
||||
auth:
|
||||
username: user
|
||||
password: pass
|
||||
metadata:
|
||||
foo: bar
|
||||
dialer:
|
||||
type: tcp
|
||||
auth:
|
||||
username: user
|
||||
password: pass
|
||||
tls:
|
||||
caFile: "ca.pem"
|
||||
secure: true
|
||||
serverName: "example.com"
|
||||
metadata:
|
||||
bar: baz
|
||||
|
||||
tls:
|
||||
certFile: "cert.pem"
|
||||
keyFile: "key.pem"
|
||||
|
Loading…
Reference in New Issue
Block a user