Documentation
¶
Index ¶
- func HTTPError(code int, err string, req *http.Request) *http.Response
- func HTTPText(code int, header http.Header, text string, req *http.Request) *http.Response
- func NewResponse(code int, header http.Header, body io.Reader, req *http.Request) *http.Response
- type Client
- type Service
- type Session
- type TCPServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPError ¶
HTTPError create a http.Response with giving error message
func HTTPText ¶
HTTPText create a http.Response with giving text
Types ¶
type Client ¶
Client each request is handled by the client
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the proxy server
func NewService ¶
NewService create a Service instance The address is that the proxy server listen on, and the tlsCfg will be used to sign the https website
func (*Service) Listen ¶
Listen proxy server start accept connection
func (*Service) OnAcceptHandler ¶
OnAcceptHandler each connection is handled by this method
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session parse the protocol on the connection and call Client.Do handle every http request
Source Files
¶
- response.go
- service.go
- session.go
- tcp.go
Click to show internal directories.
Click to hide internal directories.