Documentation ¶
Overview ¶
Package meekserver is the server transport plugin for the meek pluggable transport. It acts as an HTTP server, keeps track of session ids, and forwards received data to a local OR port.
Sample usage in torrc:
ServerTransportListenAddr meek 0.0.0.0:443 ServerTransportPlugin meek exec ./meek-server --acme-hostnames meek-server.example --acme-email admin@meek-server.example --log meek-server.log
Using your own TLS certificate:
ServerTransportListenAddr meek 0.0.0.0:8443 ServerTransportPlugin meek exec ./meek-server --cert cert.pem --key key.pem --log meek-server.log
Plain HTTP usage:
ServerTransportListenAddr meek 0.0.0.0:8080 ServerTransportPlugin meek exec ./meek-server --disable-tls --log meek-server.log
The server runs in HTTPS mode by default, getting certificates from Let's Encrypt automatically. The server opens an auxiliary ACME listener on port 80 in order for the automatic certificates to work. If you have your own certificate, use the --cert and --key options. Use --disable-tls option to run with plain HTTP.
Package meekserver provides an implementation of the Meek circumvention protocol. Only a client implementation is provided, and no effort is made to normalize the TLS fingerprint.
It borrows quite liberally from the real meek-client code.
Index ¶
- func NewMeekServerConnection(state *State, sessionID string) net.Conn
- type Config
- type MeekServer
- type Session
- type State
- func (state *State) CloseSession(sessionID string)
- func (state *State) ExpireSessions()
- func (state *State) Get(w http.ResponseWriter, req *http.Request)
- func (state *State) GetSession(sessionID string) (*Session, error)
- func (state *State) Post(w http.ResponseWriter, req *http.Request)
- func (state *State) ServeHTTP(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v2.1.11
type Config struct { AcmeEmail string `json:"acme-email"` AcmeHostname string `json:"acme-hostnames"` }
Config contains arguments formatted for a json file
type MeekServer ¶
type MeekServer struct { DisableTLS bool AcmeEmail string AcmeHostname string CertManager *autocert.Manager }
MeekServer is a Transport that uses domain fronting to shapeshift the application network traffic
func NewMeekTransportServer ¶
func NewMeekTransportServer(disableTLS bool, acmeEmail string, acmeHostnamesCommas string, stateDir string) *MeekServer
NewMeekTransportServer is a public initializer method to get a new meek transport
type Session ¶
Session id maps to an existing OR port connection, which we keep open between received requests. The first time we see a new session id, we create a new OR port connection.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State serves as the http handler There is one state per HTTP listener. In the usual case there is just one listener, so there is just one global state.
func (*State) CloseSession ¶
CloseSession removes a session from the map and closes its corresponding OR port connection. Does nothing if the session id is not known.
func (*State) ExpireSessions ¶
func (state *State) ExpireSessions()
ExpireSessions prevents an endless loop, checking for expired sessions and removing them.
func (*State) Get ¶
func (state *State) Get(w http.ResponseWriter, req *http.Request)
Get handles a GET request. This doesn't have any purpose apart from diagnostics.
func (*State) GetSession ¶
GetSession looks up a session by id, or create a new one (with its OR port connection) if it doesn't already exist.