ssStruct

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegxIsSSURI  = regexp.MustCompile(`ss:\/\/([a-zA-Z0-9\.\-_]+):([^ @]+)@([a-zA-Z0-9\.\-_]+):(\d+)`)
	RegxIsSSRURI = regexp.MustCompile(`ssr:\/\/([a-zA-Z0-9\.\-_]+:)(\d+:)([a-zA-Z0-9\.\-_]+:)+\S+`)
)

Regexp to Check URI

Functions

This section is empty.

Types

type FuncSSR

type FuncSSR struct {
	SSR
	Speed float64
	Path  string
}

FuncSSR implement func

func (*FuncSSR) SpeedTest

func (ssr *FuncSSR) SpeedTest(url string, timeout time.Duration) error

SpeedTest Test Speed of SSR Proxy

func (FuncSSR) WGet

func (ssr FuncSSR) WGet(uriAddr string, timeout time.Duration) (bs []byte, tmdelay time.Duration, err error)

WGet By ShadowsocksR Proxy

type SS

type SS struct {
	Server     string      `json:"server"`
	ServerPort json.Number `json:"server_port"`
	Password   string      `json:"password"`
	Method     string      `json:"method"`
}

SS original

func ParseSSFromURI

func ParseSSFromURI(str string) (*SS, error)

ParseSSFromURI Parse SS From URI[ss://method:pass@host:port]

func (SS) JSON

func (ss SS) JSON() string

JSON gen json form of SS

func (SS) String

func (ss SS) String() string

String gen URI[ss://method:pass@host:port] of SS

func (SS) ToSSR

func (ss SS) ToSSR(protocol, obfs string) SSR

ToSSR gen SSR

type SSR

type SSR struct {
	SS
	Protocol string `json:"protocol"`
	Obfs     string `json:"obfs"`
}

SSR implement

func ParseSSRFromURI

func ParseSSRFromURI(str string) (*SSR, error)

ParseSSRFromURI Parse SSR From URI [ssr://host:port:protocol:method:obfs:pass]

func (SSR) JSON

func (ssr SSR) JSON() string

JSON gen json form of SSR

func (SSR) String

func (ssr SSR) String() string

String gen URI[ssr://host:port:protocol:method:obfs:pass] of SSR

type SliceFuncSSR

type SliceFuncSSR []FuncSSR

SliceFuncSSR is Slice of FuncSSR

func (SliceFuncSSR) Len

func (sfssr SliceFuncSSR) Len() int

func (SliceFuncSSR) Less

func (sfssr SliceFuncSSR) Less(i, j int) bool

func (*SliceFuncSSR) SpeedTest

func (sfssr *SliceFuncSSR) SpeedTest(TestCaseLevel TestCase)

SpeedTest Test Speed of SSR Proxy

func (SliceFuncSSR) Swap

func (sfssr SliceFuncSSR) Swap(i, j int)

type SliceSS

type SliceSS []SS

SliceSS is Slice of SS

func (SliceSS) GenSSURIList

func (sss SliceSS) GenSSURIList() (ssStr []string)

GenSSURIList gen SSR to URI [ss://method:pass@host:port]

type SliceSSR

type SliceSSR []SSR

SliceSSR is Slice of SSR

func (SliceSSR) GenSSRURIList

func (ssrs SliceSSR) GenSSRURIList() (ssrStr []string)

GenSSRURIList gen SSR to URI [ssr://host:port:protocol:method:obfs:pass]

type TestCase

type TestCase int

TestCase Level

const (
	TestCaseMid   TestCase = 0
	TestCaseSmall TestCase = 1
	TestCaseTiny  TestCase = 2
)

TestCase Level

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL