Documentation ¶
Index ¶
- Constants
- Variables
- func GetRandomName(id uint64, sseed string) string
- func IncNonce(a []byte, dyn int) error
- func JSONSuccessExchange(cl *Client, in Cell, out *Cell)
- func JSONSuccessSend(cl *Client, in Cell)
- func L1peerPing(cli *Client, p *L1Peer)
- func UseNonce(a []byte) (string, error)
- type Cell
- type Circuit
- type CircuitState
- type Client
- func (cli *Client) AcceptAnswer(target, sdp string)
- func (cli *Client) AcceptOffer(target string, sdp string)
- func (c *Client) AddL2Peer(l2 *L2Peer)
- func (c *Client) AddPeer(p *L1Peer) bool
- func (c *Client) AskL2()
- func (m *Client) BuildCircuitZ() (c *Circuit)
- func (cli *Client) CreateOffer(target string, alias string, exit bool)
- func (cli *Client) DecL1Msg(p *L1Peer, msg webrtc.DataChannelMessage)
- func (c *Client) DecodeL2Msg(l2 *L2Peer, emsg string) ([]byte, bool)
- func (c *Client) DeleteL2Peer(name string)
- func (c *Client) DeletePeer(name string)
- func (cli *Client) EncL1Msg(p *L1Peer, msg []byte)
- func (c *Client) GetL2Peer(name string, gw *L1Peer, askKey bool) (*L2Peer, bool)
- func (c *Client) GetL2PeerIfExists(name string) (*L2Peer, bool)
- func (c *Client) GetNL2Peers() int
- func (c *Client) GetNPeers() int
- func (c *Client) GetOtherPeers(name string) []string
- func (c *Client) GetPeer(name string) (*L1Peer, bool)
- func (c *Client) GetPeerByAlias(alias string) (*L1Peer, bool)
- func (c *Client) HandleL2Msg(gw *L1Peer, data []byte)
- func (cli *Client) JCell(cell string)
- func (cli *Client) KeepAlive(interval time.Duration)
- func (c *Client) ListL1Peers()
- func (c *Client) ListL2Peers()
- func (m *Client) NewCircuit() (*Circuit, error)
- func (cli *Client) NewL1Peer(name string, alias string, initiator bool, exit bool) (p *L1Peer)
- func (c *Client) PeerIsPresent(name string) bool
- func (cli *Client) Redial() (err error)
- func (cli *Client) RedialOpts(add string, opts *DialOptions)
- func (m *Client) ReplyCircuit(msg string, eKey string, eNonce string)
- func (c *Client) SearchL2(q string, lang string)
- func (c *Client) SendL2(l2 *L2Peer, b []byte) error
- func (cli *Client) SingleCmd(cmd string)
- func (cli *Client) SinglePing()
- func (cli *Client) WebSocketJSONDial() (*websocket.Conn, error)
- type ClientOptions
- type DialOptions
- type FwdMsg
- type L1Peer
- type L2L1Msg
- type L2Msg
- type L2Peer
- type MinediveClient
- type MinediveServer
- func (s *MinediveServer) AddExit(cli *MinediveClient)
- func (s *MinediveServer) AddGuard(cli *MinediveClient)
- func (s *MinediveServer) DecryptAlias(alias string, gwName string) (string, error)
- func (s *MinediveServer) DelExit(cliName string)
- func (s *MinediveServer) DelGuard(cliName string)
- func (s *MinediveServer) DeleteClientByName(name string) error
- func (s *MinediveServer) FwdToTarget(m *Cell)
- func (s *MinediveServer) GetClientByName(name string) (*MinediveClient, error)
- func (s *MinediveServer) GetExit(avoid map[string]bool) (cli *MinediveClient, err error)
- func (s *MinediveServer) GetExits() []string
- func (s *MinediveServer) GetGuard(avoid map[string]bool) (cli *MinediveClient, err error)
- func (s *MinediveServer) GetGuards() []string
- func (s *MinediveServer) GetOtherPeer(cli *MinediveClient) (*MinediveClient, error)
- func (s *MinediveServer) InitMinediveServer()
- func (s *MinediveServer) MinediveAccept(w http.ResponseWriter, r *http.Request)
- func (s *MinediveServer) SendKey(c *MinediveClient, req *Cell)
- func (s *MinediveServer) SendPeer(cli *MinediveClient)
- type MinediveState
- type Node
Constants ¶
View Source
const ( CircuitStateNewStr = "new" CircuitStateKeysStr = "got all keys" )
View Source
const ( MinediveStateNewStr = "new" MinediveStateConnectingStr = "connecting" )
View Source
const (
Unknown = 0
)
Variables ¶
View Source
var (
ErrUnknownType = errors.New("unknown")
)
Functions ¶
func GetRandomName ¶
func JSONSuccessExchange ¶
func JSONSuccessSend ¶
func L1peerPing ¶
Types ¶
type Cell ¶
type Circuit ¶
type Circuit struct { CircuitID string DC *webrtc.DataChannel State string Guard Node Bridge Node Exit Node PubK [32]byte PrivK [32]byte Notification chan string CircuitEvent chan string // contains filtered or unexported fields }
func (*Circuit) SetupCircuit ¶
type CircuitState ¶
type CircuitState int
const ( CircuitStateNew CircuitState = iota + 1 CircuitStateKeys )
func (CircuitState) String ¶
func (t CircuitState) String() string
type Client ¶
type Client struct { L1Peers map[string]*L1Peer L2Peers map[string]*L2Peer Searcher func(*Client, string, string, string, string, string) //l2, q, lang, key, nonce Responder func(*Client, string) // Verbose bool PrivK [32]byte PK [32]byte Browser bool Keys map[string][32]byte Circuits []*Circuit Routes map[string]*L1Peer Notification chan string StateNotification chan MinediveState State MinediveState // contains filtered or unexported fields }
func DefaultDial ¶
func DialMiddle ¶
func DialOpts ¶
func DialOpts(addr string, opts *DialOptions) *Client
func (*Client) AcceptAnswer ¶
func (*Client) AcceptOffer ¶
func (*Client) BuildCircuitZ ¶
func (*Client) DeleteL2Peer ¶
func (*Client) DeletePeer ¶
func (*Client) GetNL2Peers ¶
func (*Client) GetOtherPeers ¶
func (*Client) HandleL2Msg ¶
func (*Client) ListL1Peers ¶
func (c *Client) ListL1Peers()
func (*Client) ListL2Peers ¶
func (c *Client) ListL2Peers()
func (*Client) NewCircuit ¶
func (*Client) PeerIsPresent ¶
func (*Client) RedialOpts ¶
func (cli *Client) RedialOpts(add string, opts *DialOptions)
func (*Client) ReplyCircuit ¶
needed: nonce, e.Key
func (*Client) SinglePing ¶
func (cli *Client) SinglePing()
type ClientOptions ¶
type ClientOptions struct {
WSopts websocket.DialOptions
}
type DialOptions ¶
type L1Peer ¶
type MinediveClient ¶
type MinediveClient struct { ID string Name string TKID string SecretKey [32]byte //internally used??? PublicKey [32]byte //internally used??? PubK [32]byte Nonce [24]byte RemoteAddr string Ws *websocket.Conn Exit bool Guard bool }
MinediveClient is the view the has of a connected client
type MinediveServer ¶
type MinediveServer struct { ServeMux http.ServeMux Dispatch func(*MinediveClient, Cell) // contains filtered or unexported fields }
func (*MinediveServer) AddExit ¶
func (s *MinediveServer) AddExit(cli *MinediveClient)
func (*MinediveServer) AddGuard ¶
func (s *MinediveServer) AddGuard(cli *MinediveClient)
func (*MinediveServer) DecryptAlias ¶
func (s *MinediveServer) DecryptAlias(alias string, gwName string) (string, error)
func (*MinediveServer) DelExit ¶
func (s *MinediveServer) DelExit(cliName string)
func (*MinediveServer) DelGuard ¶
func (s *MinediveServer) DelGuard(cliName string)
func (*MinediveServer) DeleteClientByName ¶
func (s *MinediveServer) DeleteClientByName(name string) error
func (*MinediveServer) FwdToTarget ¶
func (s *MinediveServer) FwdToTarget(m *Cell)
func (*MinediveServer) GetClientByName ¶
func (s *MinediveServer) GetClientByName(name string) (*MinediveClient, error)
func (*MinediveServer) GetExit ¶
func (s *MinediveServer) GetExit(avoid map[string]bool) (cli *MinediveClient, err error)
XXX recheck for skipped
func (*MinediveServer) GetExits ¶
func (s *MinediveServer) GetExits() []string
func (*MinediveServer) GetGuard ¶
func (s *MinediveServer) GetGuard(avoid map[string]bool) (cli *MinediveClient, err error)
func (*MinediveServer) GetGuards ¶
func (s *MinediveServer) GetGuards() []string
func (*MinediveServer) GetOtherPeer ¶
func (s *MinediveServer) GetOtherPeer(cli *MinediveClient) (*MinediveClient, error)
func (*MinediveServer) InitMinediveServer ¶
func (s *MinediveServer) InitMinediveServer()
func (*MinediveServer) MinediveAccept ¶
func (s *MinediveServer) MinediveAccept(w http.ResponseWriter, r *http.Request)
func (*MinediveServer) SendKey ¶
func (s *MinediveServer) SendKey(c *MinediveClient, req *Cell)
func (*MinediveServer) SendPeer ¶
func (s *MinediveServer) SendPeer(cli *MinediveClient)
type MinediveState ¶
type MinediveState int
const ( MinediveStateNew MinediveState = iota + 1 MinediveStateConnecting )
func (MinediveState) String ¶
func (t MinediveState) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.