baboon

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conf = struct {
	// Fake website, requests with incorrect signatures will be redirected to this address. Note that if you use the
	// baboon protocol, specify a local address whenever possible. For a cloud service provider, if it finds that you
	// are accessing an external address and sends the received data back to an in-wall connection, it may determine
	// that you are using a proxy server.
	Masker string
}{
	Masker: "https://www.zhihu.com",
}

Conf is acting as package level configuration.

Functions

This section is empty.

Types

type Client

type Client struct {
	Server string
	Cipher []byte
}

Client implemented the baboon protocol.

func NewClient

func NewClient(server string, cipher string) *Client

NewClient returns a new Client.

func (*Client) Dial

func (c *Client) Dial(ctx *daze.Context, network string, address string) (io.ReadWriteCloser, error)

Dial connects to the address on the named network.

type Server

type Server struct {
	Listen string
	Cipher []byte
	Closer io.Closer
	Masker string
	NextID uint32
}

Server implemented the baboon protocol.

func NewServer

func NewServer(listen string, cipher string) *Server

NewServer returns a new Server.

func (*Server) Close

func (s *Server) Close() error

Close listener.

func (*Server) Route

func (s *Server) Route(r *http.Request) int

Route check if the request provided the correct signature.

func (*Server) Run

func (s *Server) Run() error

Run it.

func (*Server) ServeDaze

func (s *Server) ServeDaze(w http.ResponseWriter, r *http.Request)

ServeDaze degenerate HTTP protocol and run ashe protocol on it.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

func (*Server) ServeMask

func (s *Server) ServeMask(w http.ResponseWriter, r *http.Request)

ServeMask forward the request to a fake website. From the outside, the daze server looks like a normal website.

Jump to

Keyboard shortcuts

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