Back to godoc.org

Package messages

v0.0.0-...-d7aa9b8
Latest Go to latest

The latest major version is .

Published: Oct 5, 2020 | License: BSD-3-Clause | Module: git.torproject.org/pluggable-transports/snowflake.git

Overview

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

Index

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)

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
}

Package Files

  • proxy.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier