Documentation ¶
Index ¶
- Constants
- Variables
- func CreateSocks5Handler(addr string, transportParams url.Values) (proxy.ConnHandlerFunc, error)
- func ParseAddrSpec(host string, port string) (*socks5.AddrSpec, error)
- func ParseConfig(params url.Values) (*socks5.Config, error)
- func ParseCredentials(params url.Values) ([]socks5.Authenticator, socks5.CredentialStore, error)
- func ParsePort(port string) (int, error)
- func ParseRewrites(filePath string) (socks5.AddressRewriter, error)
- func ParseRuleset(filePath string, defaultAction RuleAction) (socks5.RuleSet, error)
- type FQDNRewriter
- type FQDNRule
- type IPRangeRewriter
- type IPRangeRule
- type PortMatcherFunc
- type RewriteRule
- type Rewriter
- type Rule
- type RuleAction
- type Ruleset
Constants ¶
View Source
const ( ActionContinue = RuleAction(0) ActionAllow = RuleAction(1) ActionBlock = RuleAction(2) )
Variables ¶
View Source
var ErrInvalidPort = errors.New("port has to be 0-65535")
Functions ¶
func CreateSocks5Handler ¶
func ParseAddrSpec ¶
func ParseConfig ¶
func ParseCredentials ¶
func ParseRewrites ¶
func ParseRuleset ¶
func ParseRuleset(filePath string, defaultAction RuleAction) (socks5.RuleSet, error)
Types ¶
type FQDNRewriter ¶
type FQDNRewriter struct { WildcardPattern string PortMatcher PortMatcherFunc Target *socks5.AddrSpec }
func (*FQDNRewriter) Rewrite ¶
func (r *FQDNRewriter) Rewrite(addrSpec *socks5.AddrSpec) (*socks5.AddrSpec, bool)
type FQDNRule ¶
type FQDNRule struct { WildcardPattern string PortMatcher PortMatcherFunc Action RuleAction }
func (*FQDNRule) Match ¶
func (r *FQDNRule) Match(addrSpec *socks5.AddrSpec) (RuleAction, bool)
type IPRangeRewriter ¶
type IPRangeRewriter struct { AddrRanges iprange.Ranges PortMatcher PortMatcherFunc Target *socks5.AddrSpec }
func (*IPRangeRewriter) Rewrite ¶
func (r *IPRangeRewriter) Rewrite(addrSpec *socks5.AddrSpec) (*socks5.AddrSpec, bool)
type IPRangeRule ¶
type IPRangeRule struct { AddrRanges iprange.Ranges PortMatcher PortMatcherFunc Action RuleAction }
func (*IPRangeRule) Match ¶
func (r *IPRangeRule) Match(addrSpec *socks5.AddrSpec) (RuleAction, bool)
type PortMatcherFunc ¶
func CreatePortMatcher ¶
func CreatePortMatcher(portsDef string) (PortMatcherFunc, error)
type RewriteRule ¶
type RewriteRule interface {
Rewrite(addrSpec *socks5.AddrSpec) (*socks5.AddrSpec, bool)
}
func ParseRewriteLine ¶
func ParseRewriteLine(line string) (RewriteRule, error)
type Rewriter ¶
type Rewriter struct {
Rules []RewriteRule
}
type Rule ¶
type Rule interface {
Match(addrSpec *socks5.AddrSpec) (RuleAction, bool)
}
func ParseRuleLine ¶
type RuleAction ¶
type RuleAction int
func ParseAction ¶
func ParseAction(input string) (RuleAction, error)
Click to show internal directories.
Click to hide internal directories.