Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultConfigPath = "~/.p2p-proxy.yaml"
)
Variables ¶
View Source
var Default = &Config{ P2P: P2P{ Addrs: []string{ "/ip4/0.0.0.0/tcp/8888", }, BootstrapPeers: []string{}, }, Logging: Logging{ File: "~/p2p-proxy.log", Format: "console", Level: map[string]string{ "all": "info", }, }, Version: metadata.Version, ServiceTag: "p2p-proxy/0.0.1", Proxy: Proxy{ Protocols: []Protocol{ { Protocol: "/p2p-proxy/http/0.0.1", Config: map[string]interface{}{}, }, { Protocol: "/p2p-proxy/shadowsocks/0.0.1", Config: map[string]interface{}{}, }, { Protocol: "/p2p-proxy/socks5/0.0.1", Config: map[string]interface{}{}, }, }, ServiceAdvertiseInterval: time.Hour, }, Endpoint: Endpoint{ ProxyProtocols: []ProxyProtocol{ { Protocol: "/p2p-proxy/http/0.0.1", Listen: "127.0.0.1:8010", }, { Protocol: "/p2p-proxy/shadowsocks/0.0.1", Listen: "127.0.0.1:8020", }, { Protocol: "/p2p-proxy/socks5/0.0.1", Listen: "127.0.0.1:8030", }, }, ServiceDiscoveryInterval: time.Hour, Balancer: "round_robin", }, Interactive: false, }
View Source
var InvalidErr = errors.New("config invalid or not checked")
Functions ¶
This section is empty.
Types ¶
type BandWidthReporter ¶
type Config ¶
type Config struct { // config version Version string `yaml:"Version"` Logging Logging `yaml:"Logging"` ServiceTag string `yaml:"ServiceTag"` P2P P2P `yaml:"P2P"` Proxy Proxy `yaml:"Proxy"` Endpoint Endpoint `yaml:"Endpoint"` Interactive bool `yaml:"Interactive"` // contains filtered or unexported fields }
func Initialize ¶
func (*Config) SetupLogging ¶
func (*Config) Work4Proxy ¶
type Endpoint ¶
type Endpoint struct { ProxyProtocols []ProxyProtocol `yaml:"ProxyProtocols"` ServiceDiscoveryInterval time.Duration `yaml:"ServiceDiscoveryInterval"` Balancer string `yaml:"Balancer"` }
type P2P ¶
type P2P struct { Identity Identity `yaml:"Identity"` // libp2p multi address Addrs []string `yaml:"Addrs"` BootstrapPeers []string `yaml:"BootstrapPeers"` BandWidthReporter BandWidthReporter `yaml:"BandWidthReporter"` EnableAutoRelay bool `yaml:"EnableAutoRelay"` AutoNATService bool `yaml:"AutoNATService"` DHT DHT `yaml:"DHT"` }
type ProxyProtocol ¶
Click to show internal directories.
Click to hide internal directories.