Documentation

Overview

import "git.torproject.org/pluggable-transports/snowflake.git/common/messages"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAnswerRequest

func DecodeAnswerRequest(data []byte) (string, string, error)

Returns the sdp answer and proxy sid

func DecodeAnswerResponse

func DecodeAnswerResponse(data []byte) (bool, error)

func DecodePollRequest

func DecodePollRequest(data []byte) (string, string, string, error)

Decodes a poll message from a snowflake proxy and returns the sid and proxy type of the proxy on success and an error if it failed

func DecodePollResponse

func DecodePollResponse(data []byte) (string, string, error)

Decodes a poll response from the broker and returns an offer and the client's NAT type If there is a client match, the returned offer string will be non-empty

func EncodeAnswerRequest

func EncodeAnswerRequest(answer string, sid string) ([]byte, error)

func EncodeAnswerResponse

func EncodeAnswerResponse(success bool) ([]byte, error)

func EncodePollRequest

func EncodePollRequest(sid string, proxyType string, natType string) ([]byte, error)

func EncodePollResponse

func EncodePollResponse(offer string, success bool, natType string) ([]byte, error)

Types

type ProxyAnswerRequest

type ProxyAnswerRequest struct {
	Version string
	Sid     string
	Answer  string
}

type ProxyAnswerResponse

type ProxyAnswerResponse struct {
	Status string
}

type ProxyPollRequest

type ProxyPollRequest struct {
	Sid     string
	Version string
	Type    string
	NAT     string
}

type ProxyPollResponse

type ProxyPollResponse struct {
	Status string
	Offer  string
	NAT    string
}

Source Files