SYMBOL INDEX (488 symbols across 30 files) FILE: auth.go constant authRealm (line 18) | authRealm = "cow proxy" constant authRawBodyTmpl (line 19) | authRawBodyTmpl = ` type netAddr (line 31) | type netAddr struct type authUser (line 36) | type authUser struct method initHA1 (line 55) | func (au *authUser) initHA1(user string) { function parseUserPasswd (line 61) | func parseUserPasswd(userPasswd string) (user string, au *authUser, err ... function parseAllowedClient (line 87) | func parseAllowedClient(val string) { function addUserPasswd (line 120) | func addUserPasswd(val string) { function loadUserPasswdFile (line 135) | func loadUserPasswdFile(file string) { function initAuth (line 152) | func initAuth() { function Authenticate (line 182) | func Authenticate(conn *clientConn, r *Request) (err error) { function authIP (line 200) | func authIP(clientIP string) bool { function genNonce (line 215) | func genNonce() string { function calcRequestDigest (line 221) | func calcRequestDigest(kv map[string]string, ha1, method string) string { function checkProxyAuthorization (line 234) | func checkProxyAuthorization(conn *clientConn, r *Request) error { function authPort (line 252) | func authPort(conn *clientConn, user string, au *authUser) error { function authBasic (line 265) | func authBasic(conn *clientConn, userPasswd string) error { function authDigest (line 284) | func authDigest(conn *clientConn, r *Request, keyVal string) error { function authUserPasswd (line 326) | func authUserPasswd(conn *clientConn, r *Request) (err error) { FILE: auth_test.go function TestParseUserPasswd (line 8) | func TestParseUserPasswd(t *testing.T) { function TestCalcDigest (line 42) | func TestCalcDigest(t *testing.T) { function TestParseAllowedClient (line 58) | func TestParseAllowedClient(t *testing.T) { function TestAuthIP (line 82) | func TestAuthIP(t *testing.T) { FILE: config.go constant version (line 19) | version = "0.9.8" constant defaultListenAddr (line 20) | defaultListenAddr = "127.0.0.1:7777" constant defaultEstimateTarget (line 21) | defaultEstimateTarget = "example.com" type LoadBalanceMode (line 24) | type LoadBalanceMode constant loadBalanceBackup (line 27) | loadBalanceBackup LoadBalanceMode = iota constant loadBalanceHash (line 28) | loadBalanceHash constant loadBalanceLatency (line 29) | loadBalanceLatency type Config (line 42) | type Config struct function printVersion (line 84) | func printVersion() { function initConfig (line 88) | func initConfig(rcFile string) { function parseCmdLineConfig (line 112) | func parseCmdLineConfig() *Config { function parseBool (line 143) | func parseBool(v, msg string) bool { function parseInt (line 155) | func parseInt(val, msg string) (i int) { function parseDuration (line 163) | func parseDuration(val, msg string) (d time.Duration) { function checkServerAddr (line 171) | func checkServerAddr(addr string) error { function isUserPasswdValid (line 176) | func isUserPasswdValid(val string) bool { type proxyParser (line 185) | type proxyParser struct method ProxySocks5 (line 187) | func (p proxyParser) ProxySocks5(val string) { method ProxyHttp (line 194) | func (pp proxyParser) ProxyHttp(val string) { method ProxySs (line 245) | func (pp proxyParser) ProxySs(val string) { method ProxyCow (line 255) | func (pp proxyParser) ProxyCow(val string) { function parseMethodPasswdServer (line 219) | func parseMethodPasswdServer(val string) (method, passwd, server string,... type listenParser (line 271) | type listenParser struct method ListenHttp (line 273) | func (lp listenParser) ListenHttp(val string) { method ListenCow (line 294) | func (lp listenParser) ListenCow(val string) { type configParser (line 306) | type configParser struct method ParseProxy (line 308) | func (p configParser) ParseProxy(val string) { method ParseListen (line 327) | func (p configParser) ParseListen(val string) { method ParseLogFile (line 355) | func (p configParser) ParseLogFile(val string) { method ParseAddrInPAC (line 359) | func (p configParser) ParseAddrInPAC(val string) { method ParseTunnelAllowedPort (line 382) | func (p configParser) ParseTunnelAllowedPort(val string) { method ParseSocksParent (line 393) | func (p configParser) ParseSocksParent(val string) { method ParseSshServer (line 399) | func (p configParser) ParseSshServer(val string) { method ParseHttpParent (line 421) | func (p configParser) ParseHttpParent(val string) { method ParseHttpUserPasswd (line 432) | func (p configParser) ParseHttpUserPasswd(val string) { method ParseAlwaysProxy (line 443) | func (p configParser) ParseAlwaysProxy(val string) { method ParseLoadBalance (line 447) | func (p configParser) ParseLoadBalance(val string) { method ParseStatFile (line 460) | func (p configParser) ParseStatFile(val string) { method ParseBlockedFile (line 464) | func (p configParser) ParseBlockedFile(val string) { method ParseDirectFile (line 471) | func (p configParser) ParseDirectFile(val string) { method ParseShadowSocks (line 488) | func (p configParser) ParseShadowSocks(val string) { method ParseShadowPasswd (line 514) | func (p configParser) ParseShadowPasswd(val string) { method ParseShadowMethod (line 525) | func (p configParser) ParseShadowMethod(val string) { method ParseUserPasswd (line 547) | func (p configParser) ParseUserPasswd(val string) { method ParseUserPasswdFile (line 554) | func (p configParser) ParseUserPasswdFile(val string) { method ParseAllowedClient (line 562) | func (p configParser) ParseAllowedClient(val string) { method ParseAuthTimeout (line 566) | func (p configParser) ParseAuthTimeout(val string) { method ParseCore (line 570) | func (p configParser) ParseCore(val string) { method ParseHttpErrorCode (line 574) | func (p configParser) ParseHttpErrorCode(val string) { method ParseReadTimeout (line 578) | func (p configParser) ParseReadTimeout(val string) { method ParseDialTimeout (line 582) | func (p configParser) ParseDialTimeout(val string) { method ParseDetectSSLErr (line 586) | func (p configParser) ParseDetectSSLErr(val string) { method ParseEstimateTarget (line 590) | func (p configParser) ParseEstimateTarget(val string) { function checkShadowsocks (line 534) | func checkShadowsocks() { function parseConfig (line 596) | func parseConfig(rc string, override *Config) { function upgradeConfig (line 652) | func upgradeConfig(rc string, lines []string) { function overrideConfig (line 715) | func overrideConfig(oldconfig, override *Config) { function checkConfig (line 743) | func checkConfig() { FILE: config_test.go function TestParseListen (line 7) | func TestParseListen(t *testing.T) { function TestTunnelAllowedPort (line 26) | func TestTunnelAllowedPort(t *testing.T) { function TestParseProxy (line 56) | func TestParseProxy(t *testing.T) { FILE: config_unix.go constant rcFname (line 10) | rcFname = "rc" constant blockedFname (line 11) | blockedFname = "blocked" constant directFname (line 12) | directFname = "direct" constant statFname (line 13) | statFname = "stat" constant newLine (line 15) | newLine = "\n" function getDefaultRcFile (line 18) | func getDefaultRcFile() string { FILE: config_windows.go constant rcFname (line 9) | rcFname = "rc.txt" constant blockedFname (line 10) | blockedFname = "blocked.txt" constant directFname (line 11) | directFname = "direct.txt" constant statFname (line 12) | statFname = "stat.txt" constant newLine (line 14) | newLine = "\r\n" function getDefaultRcFile (line 17) | func getDefaultRcFile() string { FILE: conn_pool.go constant maxServerConnCnt (line 11) | maxServerConnCnt = 5 type ConnPool (line 15) | type ConnPool struct method Get (line 63) | func (cp *ConnPool) Get(hostPort string, asDirect bool) (sv *serverCon... method Put (line 92) | func (cp *ConnPool) Put(sv *serverConn) { method CloseAll (line 124) | func (cp *ConnPool) CloseAll() { constant muxConnHostPort (line 26) | muxConnHostPort = "@muxConn" function init (line 28) | func init() { function getConnFromChan (line 33) | func getConnFromChan(ch chan *serverConn) (sv *serverConn) { function putConnToChan (line 48) | func putConnToChan(sv *serverConn, ch chan *serverConn, chname string) { type chanInPool (line 119) | type chanInPool struct function closeServerConn (line 143) | func closeServerConn(ch chan *serverConn, hostPort string, force bool) (... function closeStaleServerConn (line 176) | func closeStaleServerConn(ch chan *serverConn, hostPort string) { FILE: conn_pool_test.go function TestGetFromEmptyPool (line 8) | func TestGetFromEmptyPool(t *testing.T) { function TestConnPool (line 16) | func TestConnPool(t *testing.T) { FILE: error.go function init (line 21) | func init() { function genErrorPage (line 48) | func genErrorPage(h1, msg string) (string, error) { function sendPageGeneric (line 65) | func sendPageGeneric(w io.Writer, codeReason, h1, msg string) { function sendErrorPage (line 90) | func sendErrorPage(w io.Writer, codeReason, h1, msg string) { FILE: estimate_timeout.go constant minDialTimeout (line 12) | minDialTimeout = 3 * time.Second constant minReadTimeout (line 13) | minReadTimeout = 4 * time.Second constant defaultDialTimeout (line 14) | defaultDialTimeout = 5 * time.Second constant defaultReadTimeout (line 15) | defaultReadTimeout = 5 * time.Second constant maxTimeout (line 16) | maxTimeout = 15 * time.Second function estimateTimeout (line 24) | func estimateTimeout(host string, payload []byte) { function runEstimateTimeout (line 85) | func runEstimateTimeout() { function networkBad (line 106) | func networkBad() bool { FILE: http.go constant CRLF (line 14) | CRLF = "\r\n" constant statusCodeContinue (line 17) | statusCodeContinue = 100 constant statusBadReq (line 21) | statusBadReq = "400 Bad Request" constant statusForbidden (line 22) | statusForbidden = "403 Forbidden" constant statusExpectFailed (line 23) | statusExpectFailed = "417 Expectation Failed" constant statusRequestTimeout (line 24) | statusRequestTimeout = "408 Request Timeout" type Header (line 29) | type Header struct method parseConnection (line 380) | func (h *Header) parseConnection(s []byte) error { method parseContentLength (line 386) | func (h *Header) parseContentLength(s []byte) (err error) { method parseHost (line 391) | func (h *Header) parseHost(s []byte) (err error) { method parseKeepAlive (line 398) | func (h *Header) parseKeepAlive(s []byte) (err error) { method parseProxyAuthorization (line 415) | func (h *Header) parseProxyAuthorization(s []byte) error { method parseTransferEncoding (line 420) | func (h *Header) parseTransferEncoding(s []byte) error { method parseTrailer (line 440) | func (h *Header) parseTrailer(s []byte) error { method parseExpect (line 454) | func (h *Header) parseExpect(s []byte) error { method parseHeader (line 551) | func (h *Header) parseHeader(reader *bufio.Reader, raw *bytes.Buffer, ... type rqState (line 40) | type rqState constant rsCreated (line 43) | rsCreated rqState = iota constant rsSent (line 44) | rsSent constant rsRecvBody (line 45) | rsRecvBody constant rsDone (line 46) | rsDone type Request (line 49) | type Request struct method reset (line 71) | func (r *Request) reset() { method String (line 86) | func (r *Request) String() (s string) { method Verbose (line 90) | func (r *Request) Verbose() []byte { method hasBody (line 104) | func (r *Request) hasBody() bool { method isRetry (line 108) | func (r *Request) isRetry() bool { method tryOnce (line 112) | func (r *Request) tryOnce() { method tooManyRetry (line 116) | func (r *Request) tooManyRetry() bool { method responseNotSent (line 120) | func (r *Request) responseNotSent() bool { method hasSent (line 124) | func (r *Request) hasSent() bool { method releaseBuf (line 128) | func (r *Request) releaseBuf() { method rawRequest (line 137) | func (r *Request) rawRequest() []byte { method rawBeforeBody (line 141) | func (r *Request) rawBeforeBody() []byte { method rawHeaderBody (line 145) | func (r *Request) rawHeaderBody() []byte { method rawBody (line 149) | func (r *Request) rawBody() []byte { method proxyRequestLine (line 153) | func (r *Request) proxyRequestLine() []byte { method genRequestLine (line 157) | func (r *Request) genRequestLine() { type Response (line 168) | type Response struct method reset (line 180) | func (rp *Response) reset() { method releaseBuf (line 195) | func (rp *Response) releaseBuf() { method rawResponse (line 203) | func (rp *Response) rawResponse() []byte { method genStatusLine (line 207) | func (rp *Response) genStatusLine() { method String (line 218) | func (rp *Response) String() string { method Verbose (line 222) | func (rp *Response) Verbose() []byte { method hasBody (line 648) | func (rp *Response) hasBody(method string) bool { type URL (line 226) | type URL struct method String (line 234) | func (url *URL) String() string { method ParseHostPort (line 239) | func (url *URL) ParseHostPort(hostPort string) { function ParseRequestURI (line 262) | func ParseRequestURI(rawurl string) (*URL, error) { function ParseRequestURIBytes (line 266) | func ParseRequestURIBytes(rawurl []byte) (*URL, error) { constant headerConnection (line 321) | headerConnection = "connection" constant headerContentLength (line 322) | headerContentLength = "content-length" constant headerExpect (line 323) | headerExpect = "expect" constant headerHost (line 324) | headerHost = "host" constant headerKeepAlive (line 325) | headerKeepAlive = "keep-alive" constant headerProxyAuthenticate (line 326) | headerProxyAuthenticate = "proxy-authenticate" constant headerProxyAuthorization (line 327) | headerProxyAuthorization = "proxy-authorization" constant headerProxyConnection (line 328) | headerProxyConnection = "proxy-connection" constant headerReferer (line 329) | headerReferer = "referer" constant headerTE (line 330) | headerTE = "te" constant headerTrailer (line 331) | headerTrailer = "trailer" constant headerTransferEncoding (line 332) | headerTransferEncoding = "transfer-encoding" constant headerUpgrade (line 333) | headerUpgrade = "upgrade" constant fullHeaderConnectionKeepAlive (line 335) | fullHeaderConnectionKeepAlive = "Connection: keep-alive\r\n" constant fullHeaderConnectionClose (line 336) | fullHeaderConnectionClose = "Connection: close\r\n" constant fullHeaderTransferEncoding (line 337) | fullHeaderTransferEncoding = "Transfer-Encoding: chunked\r\n" type HeaderParserFunc (line 372) | type HeaderParserFunc function splitHeader (line 466) | func splitHeader(s []byte) (name, val []byte, err error) { function readContinuedLineSlice (line 478) | func readContinuedLineSlice(r *bufio.Reader) ([]byte, error) { function skipSpace (line 533) | func skipSpace(r *bufio.Reader) int { function parseRequest (line 582) | func parseRequest(c *clientConn, r *Request) (err error) { function parseResponse (line 657) | func parseResponse(sv *serverConn, r *Request, rp *Response) (err error) { function unquote (line 753) | func unquote(s string) string { function parseKeyValueList (line 757) | func parseKeyValueList(str string) map[string]string { FILE: http_test.go function TestParseRequestURI (line 11) | func TestParseRequestURI(t *testing.T) { function TestParseHeader (line 65) | func TestParseHeader(t *testing.T) { FILE: log.go type infoLogging (line 16) | type infoLogging method Printf (line 73) | func (d infoLogging) Printf(format string, args ...interface{}) { method Println (line 79) | func (d infoLogging) Println(args ...interface{}) { type debugLogging (line 17) | type debugLogging method Printf (line 85) | func (d debugLogging) Printf(format string, args ...interface{}) { method Println (line 91) | func (d debugLogging) Println(args ...interface{}) { type errorLogging (line 18) | type errorLogging method Printf (line 97) | func (d errorLogging) Printf(format string, args ...interface{}) { method Println (line 103) | func (d errorLogging) Println(args ...interface{}) { type requestLogging (line 19) | type requestLogging method Printf (line 109) | func (d requestLogging) Printf(format string, args ...interface{}) { type responseLogging (line 20) | type responseLogging method Printf (line 115) | func (d responseLogging) Printf(format string, args ...interface{}) { function init (line 41) | func init() { function initLog (line 51) | func initLog() { function Fatal (line 121) | func Fatal(args ...interface{}) { function Fatalf (line 126) | func Fatalf(format string, args ...interface{}) { FILE: main.go function lookPath (line 20) | func lookPath() (argv0 string, err error) { function main (line 31) | func main() { FILE: main_unix.go function sigHandler (line 11) | func sigHandler() { FILE: main_windows.go function sigHandler (line 9) | func sigHandler() { FILE: pac.go function getDirectList (line 23) | func getDirectList() string { function updateDirectList (line 30) | func updateDirectList() { function init (line 37) | func init() { function genPAC (line 149) | func genPAC(c *clientConn) []byte { function initPAC (line 198) | func initPAC() { function sendPAC (line 210) | func sendPAC(c *clientConn) error { FILE: pac.js function hostIsIP (line 27) | function hostIsIP(host) { function host2Domain (line 54) | function host2Domain(host) { function FindProxyForURL (line 86) | function FindProxyForURL(url, host) { FILE: parent_proxy.go type ParentProxy (line 20) | type ParentProxy interface type ParentPool (line 27) | type ParentPool interface function initParentPool (line 39) | func initParentPool() { function printParentProxy (line 67) | func printParentProxy(parent []ParentWithFail) { type ParentWithFail (line 83) | type ParentWithFail struct method connect (line 118) | func (parent *ParentWithFail) connect(url *URL) (srvconn net.Conn, err... type backupParentPool (line 90) | type backupParentPool struct method empty (line 94) | func (pp *backupParentPool) empty() bool { method add (line 98) | func (pp *backupParentPool) add(parent ParentProxy) { method connect (line 102) | func (pp *backupParentPool) connect(url *URL) (srvconn net.Conn, err e... type hashParentPool (line 108) | type hashParentPool struct method connect (line 112) | func (pp *hashParentPool) connect(url *URL) (srvconn net.Conn, err err... function connectInOrder (line 131) | func connectInOrder(url *URL, pp []ParentWithFail, start int) (srvconn n... type ParentWithLatency (line 161) | type ParentWithLatency struct method updateLatency (line 239) | func (parent *ParentWithLatency) updateLatency(wg *sync.WaitGroup) { type latencyParentPool (line 166) | type latencyParentPool struct method empty (line 178) | func (pp *latencyParentPool) empty() bool { method add (line 182) | func (pp *latencyParentPool) add(parent ParentProxy) { method Len (line 187) | func (pp *latencyParentPool) Len() int { method Swap (line 191) | func (pp *latencyParentPool) Swap(i, j int) { method Less (line 196) | func (pp *latencyParentPool) Less(i, j int) bool { method connect (line 205) | func (pp *latencyParentPool) connect(url *URL) (srvconn net.Conn, err ... method updateLatency (line 276) | func (pp *latencyParentPool) updateLatency() { function newLatencyParentPool (line 170) | func newLatencyParentPool(parent []ParentWithFail) *latencyParentPool { constant latencyMax (line 201) | latencyMax = time.Hour function updateParentProxyLatency (line 300) | func updateParentProxyLatency() { type httpParent (line 313) | type httpParent struct method getServer (line 332) | func (hp *httpParent) getServer() string { method genConfig (line 336) | func (hp *httpParent) genConfig() string { method initAuth (line 344) | func (hp *httpParent) initAuth(userPasswd string) { method connect (line 353) | func (hp *httpParent) connect(url *URL) (net.Conn, error) { type httpConn (line 319) | type httpConn struct method String (line 324) | func (s httpConn) String() string { function newHttpParent (line 328) | func newHttpParent(server string) *httpParent { type shadowsocksParent (line 366) | type shadowsocksParent struct method getServer (line 390) | func (sp *shadowsocksParent) getServer() string { method genConfig (line 394) | func (sp *shadowsocksParent) genConfig() string { method initCipher (line 402) | func (sp *shadowsocksParent) initCipher(method, passwd string) { method connect (line 412) | func (sp *shadowsocksParent) connect(url *URL) (net.Conn, error) { type shadowsocksConn (line 373) | type shadowsocksConn struct method String (line 378) | func (s shadowsocksConn) String() string { function newShadowsocksParent (line 386) | func newShadowsocksParent(server string) *shadowsocksParent { type cowParent (line 424) | type cowParent struct method getServer (line 448) | func (cp *cowParent) getServer() string { method genConfig (line 452) | func (cp *cowParent) genConfig() string { method connect (line 460) | func (cp *cowParent) connect(url *URL) (net.Conn, error) { type cowConn (line 431) | type cowConn struct method String (line 436) | func (s cowConn) String() string { function newCowParent (line 440) | func newCowParent(srv, method, passwd string) *cowParent { type socksParent (line 496) | type socksParent struct method getServer (line 513) | func (sp *socksParent) getServer() string { method genConfig (line 517) | func (sp *socksParent) genConfig() string { method connect (line 521) | func (sp *socksParent) connect(url *URL) (net.Conn, error) { type socksConn (line 500) | type socksConn struct method String (line 505) | func (s socksConn) String() string { function newSocksParent (line 509) | func newSocksParent(server string) *socksParent { FILE: proxy.go constant httpBufSize (line 30) | httpBufSize = 8192 constant defaultServerConnTimeout (line 37) | defaultServerConnTimeout = 15 * time.Second constant clientConnTimeout (line 43) | clientConnTimeout = 15 * time.Second constant fullKeepAliveHeader (line 44) | fullKeepAliveHeader = "Keep-Alive: timeout=15\r\n" constant sslLeastDuration (line 49) | sslLeastDuration = time.Second type RetryError (line 54) | type RetryError struct function isErrRetry (line 58) | func isErrRetry(err error) bool { type directConn (line 68) | type directConn struct method String (line 72) | func (dc directConn) String() string { type serverConnState (line 76) | type serverConnState constant svConnected (line 79) | svConnected serverConnState = iota constant svSendRecvResponse (line 80) | svSendRecvResponse constant svStopped (line 81) | svStopped type serverConn (line 84) | type serverConn struct method isDirect (line 890) | func (sv *serverConn) isDirect() bool { method updateVisit (line 895) | func (sv *serverConn) updateVisit() { method initBuf (line 907) | func (sv *serverConn) initBuf() { method releaseBuf (line 914) | func (sv *serverConn) releaseBuf() { method Close (line 923) | func (sv *serverConn) Close() error { method maybeFake (line 932) | func (sv *serverConn) maybeFake() bool { method setReadTimeout (line 949) | func (sv *serverConn) setReadTimeout(msg string) { method unsetReadTimeout (line 959) | func (sv *serverConn) unsetReadTimeout(msg string) { method maybeSSLErr (line 963) | func (sv *serverConn) maybeSSLErr(cliStart time.Time) bool { method mayBeClosed (line 970) | func (sv *serverConn) mayBeClosed() bool { method doConnect (line 1163) | func (sv *serverConn) doConnect(r *Request, c *clientConn) (err error) { method sendHTTPProxyRequestHeader (line 1213) | func (sv *serverConn) sendHTTPProxyRequestHeader(r *Request, c *client... method sendRequestHeader (line 1238) | func (sv *serverConn) sendRequestHeader(r *Request, c *clientConn) (er... method sendRequestBody (line 1255) | func (sv *serverConn) sendRequestBody(r *Request, c *clientConn) (err ... method doRequest (line 1277) | func (sv *serverConn) doRequest(c *clientConn, r *Request, rp *Respons... type clientConn (line 95) | type clientConn struct method releaseBuf (line 271) | func (c *clientConn) releaseBuf() { method Close (line 280) | func (c *clientConn) Close() { method setReadTimeout (line 289) | func (c *clientConn) setReadTimeout(msg string) { method unsetReadTimeout (line 299) | func (c *clientConn) unsetReadTimeout(msg string) { method serveSelfURL (line 357) | func (c *clientConn) serveSelfURL(r *Request) (err error) { method shouldRetry (line 378) | func (c *clientConn) shouldRetry(r *Request, sv *serverConn, re error)... method serve (line 438) | func (c *clientConn) serve() { method handleBlockedRequest (line 594) | func (c *clientConn) handleBlockedRequest(r *Request, err error) error { method handleServerReadError (line 599) | func (c *clientConn) handleServerReadError(r *Request, sv *serverConn,... method handleServerWriteError (line 618) | func (c *clientConn) handleServerWriteError(r *Request, sv *serverConn... method readResponse (line 643) | func (c *clientConn) readResponse(sv *serverConn, r *Request, rp *Resp... method getServerConn (line 718) | func (c *clientConn) getServerConn(r *Request) (*serverConn, error) { method connect (line 799) | func (c *clientConn) connect(r *Request, siteInfo *VisitCnt) (srvconn ... method createServerConn (line 865) | func (c *clientConn) createServerConn(r *Request, siteInfo *VisitCnt) ... type Proxy (line 108) | type Proxy interface function addListenProxy (line 116) | func addListenProxy(p Proxy) { type httpProxy (line 120) | type httpProxy struct method genConfig (line 134) | func (proxy *httpProxy) genConfig() string { method Addr (line 142) | func (proxy *httpProxy) Addr() string { method Serve (line 146) | func (hp *httpProxy) Serve(wg *sync.WaitGroup, quit <-chan struct{}) { function newHttpProxy (line 126) | func newHttpProxy(addr, addrInPAC string) *httpProxy { type cowProxy (line 192) | type cowProxy struct method genConfig (line 207) | func (cp *cowProxy) genConfig() string { method Addr (line 215) | func (cp *cowProxy) Addr() string { method Serve (line 219) | func (cp *cowProxy) Serve(wg *sync.WaitGroup, quit <-chan struct{}) { function newCowProxy (line 199) | func newCowProxy(method, passwd, addr string) *cowProxy { function newClientConn (line 256) | func newClientConn(cli net.Conn, proxy Proxy) *clientConn { function initSelfListenAddr (line 309) | func initSelfListenAddr() { function isSelfRequest (line 337) | func isSelfRequest(r *Request) bool { function dbgPrintRq (line 418) | func dbgPrintRq(c *clientConn, r *Request) { type SinkWriter (line 432) | type SinkWriter struct method Write (line 434) | func (s SinkWriter) Write(p []byte) (int, error) { function genErrMsg (line 586) | func genErrMsg(r *Request, sv *serverConn, what string) string { function dbgPrintRep (line 627) | func dbgPrintRep(c *clientConn, r *Request, rp *Response) { function connectDirect2 (line 741) | func connectDirect2(url *URL, siteInfo *VisitCnt, recursive bool) (net.C... function connectDirect (line 769) | func connectDirect(url *URL, siteInfo *VisitCnt) (net.Conn, error) { function isErrTimeout (line 773) | func isErrTimeout(err error) bool { function isHttpErrCode (line 780) | func isHttpErrCode(err error) bool { function maybeBlocked (line 790) | func maybeBlocked(err error) bool { function newServerConn (line 881) | func newServerConn(c net.Conn, hostPort string, siteInfo *VisitCnt) *ser... function setConnReadTimeout (line 936) | func setConnReadTimeout(cn net.Conn, d time.Duration, msg string) { function unsetConnReadTimeout (line 942) | func unsetConnReadTimeout(cn net.Conn, msg string) { constant connectBufSize (line 980) | connectBufSize = 4096 function copyServer2Client (line 986) | func copyServer2Client(sv *serverConn, c *clientConn, r *Request) (err e... type serverWriter (line 1039) | type serverWriter struct method Write (line 1051) | func (sw *serverWriter) Write(p []byte) (int, error) { function newServerWriter (line 1044) | func newServerWriter(r *Request, sv *serverConn) *serverWriter { function copyClient2Server (line 1069) | func copyClient2Server(c *clientConn, sv *serverConn, r *Request, srvSto... function sendBodyWithContLen (line 1293) | func sendBodyWithContLen(w io.Writer, r *bufio.Reader, contLen int) (err... function skipTrailer (line 1305) | func skipTrailer(r *bufio.Reader) error { function skipCRLF (line 1324) | func skipCRLF(r *bufio.Reader) (err error) { function sendBodyChunked (line 1339) | func sendBodyChunked(w io.Writer, r *bufio.Reader, rdSize int) (err erro... constant chunkEnd (line 1390) | chunkEnd = "0\r\n\r\n" function sendBodySplitIntoChunk (line 1392) | func sendBodySplitIntoChunk(w io.Writer, r *bufio.Reader) (err error) { function sendBody (line 1429) | func sendBody(w io.Writer, bufRd *bufio.Reader, contLen int, chunk bool)... FILE: proxy_test.go function TestSendBodyChunked (line 10) | func TestSendBodyChunked(t *testing.T) { function TestInitSelfListenAddr (line 55) | func TestInitSelfListenAddr(t *testing.T) { FILE: proxy_unix.go function isErrConnReset (line 11) | func isErrConnReset(err error) bool { function isDNSError (line 18) | func isDNSError(err error) bool { function isErrOpWrite (line 25) | func isErrOpWrite(err error) bool { function isErrOpRead (line 33) | func isErrOpRead(err error) bool { function isErrTooManyOpenFd (line 41) | func isErrTooManyOpenFd(err error) bool { FILE: proxy_windows.go function isErrConnReset (line 12) | func isErrConnReset(err error) bool { function isDNSError (line 26) | func isDNSError(err error) bool { function isErrOpWrite (line 39) | func isErrOpWrite(err error) bool { function isErrOpRead (line 47) | func isErrOpRead(err error) bool { function isErrTooManyOpenFd (line 55) | func isErrTooManyOpenFd(err error) bool { FILE: sitestat.go function init (line 17) | func init() { constant directDelta (line 26) | directDelta = 5 constant blockedDelta (line 27) | blockedDelta = 5 constant maxCnt (line 28) | maxCnt = 100 constant userCnt (line 29) | userCnt = -1 type siteVisitMethod (line 32) | type siteVisitMethod type vcntint (line 35) | type vcntint type Date (line 37) | type Date method MarshalJSON (line 41) | func (d Date) MarshalJSON() ([]byte, error) { method UnmarshalJSON (line 45) | func (d *Date) UnmarshalJSON(input []byte) error { constant dateLayout (line 39) | dateLayout = "2006-01-02" type VisitCnt (line 57) | type VisitCnt struct method userSpecified (line 73) | func (vc *VisitCnt) userSpecified() bool { method isStale (line 79) | func (vc *VisitCnt) isStale() bool { method shouldNotSave (line 85) | func (vc *VisitCnt) shouldNotSave() bool { method AsTempBlocked (line 91) | func (vc *VisitCnt) AsTempBlocked() bool { method AsDirect (line 95) | func (vc *VisitCnt) AsDirect() bool { method AsBlocked (line 99) | func (vc *VisitCnt) AsBlocked() bool { method AlwaysDirect (line 108) | func (vc *VisitCnt) AlwaysDirect() bool { method AlwaysBlocked (line 112) | func (vc *VisitCnt) AlwaysBlocked() bool { method OnceBlocked (line 116) | func (vc *VisitCnt) OnceBlocked() bool { method tempBlocked (line 120) | func (vc *VisitCnt) tempBlocked() { method visit (line 130) | func (vc *VisitCnt) visit(inc *vcntint) { method DirectVisit (line 148) | func (vc *VisitCnt) DirectVisit() { method BlockedVisit (line 158) | func (vc *VisitCnt) BlockedVisit() { function newVisitCnt (line 65) | func newVisitCnt(direct, blocked vcntint) *VisitCnt { function newVisitCntWithTime (line 69) | func newVisitCntWithTime(direct, blocked vcntint, t time.Time) *VisitCnt { constant siteStaleThreshold (line 77) | siteStaleThreshold = 10 * 24 * time.Hour constant tmpBlockedTimeout (line 89) | tmpBlockedTimeout = 2 * time.Minute type SiteStat (line 170) | type SiteStat struct method get (line 188) | func (ss *SiteStat) get(s string) *VisitCnt { method create (line 198) | func (ss *SiteStat) create(s string) (vcnt *VisitCnt) { method TempBlocked (line 208) | func (ss *SiteStat) TempBlocked(url *URL) { method GetVisitCnt (line 235) | func (ss *SiteStat) GetVisitCnt(url *URL) (vcnt *VisitCnt) { method store (line 255) | func (ss *SiteStat) store(statPath string) (err error) { method loadList (line 314) | func (ss *SiteStat) loadList(lst []string, direct, blocked vcntint) { method loadBuiltinList (line 320) | func (ss *SiteStat) loadBuiltinList() { method loadUserList (line 325) | func (ss *SiteStat) loadUserList() { method filterSites (line 336) | func (ss *SiteStat) filterSites() { method load (line 369) | func (ss *SiteStat) load(file string) (err error) { method GetDirectList (line 408) | func (ss *SiteStat) GetDirectList() []string { function newSiteStat (line 181) | func newSiteStat() *SiteStat { function initSiteStat (line 426) | func initSiteStat() { constant siteStatExit (line 451) | siteStatExit = iota constant siteStatCont (line 452) | siteStatCont function storeSiteStat (line 460) | func storeSiteStat(cont byte) { function loadSiteList (line 473) | func loadSiteList(fpath string) (lst []string, err error) { FILE: sitestat_test.go function TestNetworkBad (line 11) | func TestNetworkBad(t *testing.T) { function TestDateMarshal (line 17) | func TestDateMarshal(t *testing.T) { function TestSiteStatLoadStore (line 37) | func TestSiteStatLoadStore(t *testing.T) { function TestSiteStatVisitCnt (line 120) | func TestSiteStatVisitCnt(t *testing.T) { function TestSiteStatGetVisitCnt (line 189) | func TestSiteStatGetVisitCnt(t *testing.T) { FILE: ssh.go function SshRunning (line 10) | func SshRunning(socksServer string) bool { function runOneSSH (line 19) | func runOneSSH(server string) { function runSSH (line 49) | func runSSH() { FILE: stat.go function initStat (line 16) | func initStat() { function incCliCnt (line 23) | func incCliCnt() int32 { function decCliCnt (line 28) | func decCliCnt() int32 { function addSrvConnCnt (line 33) | func addSrvConnCnt(srv string, delta int) int { function incSrvConnCnt (line 41) | func incSrvConnCnt(srv string) int { function decSrvConnCnt (line 45) | func decSrvConnCnt(srv string) int { FILE: timeoutset.go type TimeoutSet (line 8) | type TimeoutSet struct method add (line 21) | func (ts *TimeoutSet) add(key string) { method has (line 28) | func (ts *TimeoutSet) has(key string) bool { method del (line 42) | func (ts *TimeoutSet) del(key string) { function NewTimeoutSet (line 14) | func NewTimeoutSet(timeout time.Duration) *TimeoutSet { FILE: util.go constant isWindows (line 19) | isWindows = runtime.GOOS == "windows" type notification (line 21) | type notification method notify (line 28) | func (n notification) notify() { method hasNotified (line 32) | func (n notification) hasNotified() bool { function newNotification (line 23) | func newNotification() notification { function ASCIIToUpperInplace (line 41) | func ASCIIToUpperInplace(b []byte) { function ASCIIToUpper (line 49) | func ASCIIToUpper(b []byte) []byte { function ASCIIToLowerInplace (line 61) | func ASCIIToLowerInplace(b []byte) { function ASCIIToLower (line 69) | func ASCIIToLower(b []byte) []byte { function IsDigit (line 81) | func IsDigit(b byte) bool { function IsSpace (line 92) | func IsSpace(b byte) bool { function TrimSpace (line 96) | func TrimSpace(s []byte) []byte { function TrimTrailingSpace (line 109) | func TrimTrailingSpace(s []byte) []byte { function FieldsN (line 122) | func FieldsN(s []byte, n int) [][]byte { function ParseIntFromBytes (line 167) | func ParseIntFromBytes(b []byte, base int) (n int64, err error) { function isFileExists (line 209) | func isFileExists(path string) error { function isDirExists (line 220) | func isDirExists(path string) error { function getUserHomeDir (line 231) | func getUserHomeDir() string { function expandTilde (line 239) | func expandTilde(pth string) string { function copyN (line 250) | func copyN(dst io.Writer, src *bufio.Reader, n, rdSize int) (err error) { function md5sum (line 284) | func md5sum(ss ...string) string { function hostIsIP (line 294) | func hostIsIP(host string) (isIP, isPrivate bool) { function NewNbitIPv4Mask (line 321) | func NewNbitIPv4Mask(n int) net.IPMask { function trimLastDot (line 348) | func trimLastDot(s string) string { function host2Domain (line 357) | func host2Domain(host string) (domain string) { function IgnoreUTF8BOM (line 391) | func IgnoreUTF8BOM(f *os.File) error { function hostAddr (line 410) | func hostAddr() (addr []string) { FILE: util_test.go function TestASCIIToUpper (line 12) | func TestASCIIToUpper(t *testing.T) { function TestASCIIToLower (line 29) | func TestASCIIToLower(t *testing.T) { function TestIsDigit (line 46) | func TestIsDigit(t *testing.T) { function TestIsSpace (line 61) | func TestIsSpace(t *testing.T) { function TestTrimSpace (line 83) | func TestTrimSpace(t *testing.T) { function TestTrimTrailingSpace (line 103) | func TestTrimTrailingSpace(t *testing.T) { function TestFieldsN (line 123) | func TestFieldsN(t *testing.T) { function TestParseIntFromBytes (line 154) | func TestParseIntFromBytes(t *testing.T) { function TestCopyN (line 188) | func TestCopyN(t *testing.T) { function TestIsFileExists (line 205) | func TestIsFileExists(t *testing.T) { function TestNewNbitIPv4Mask (line 222) | func TestNewNbitIPv4Mask(t *testing.T) { function TestHost2Domain (line 247) | func TestHost2Domain(t *testing.T) { function TestHostIsIP (line 273) | func TestHostIsIP(t *testing.T) {