ptc: Index | Files

package ptc

import ""


Package Files

args.go client.go dial.go ptc.go server.go

type Args Uses

type Args map[string][]string

Args maps a string key to a list of values. It is similar to url.Values.

func (Args) Add Uses

func (args Args) Add(key, value string)

Append value to the list of values for key.

func (Args) Get Uses

func (args Args) Get(key string) (value string, ok bool)

Get the first value associated with the given key. If there are any values associated with the key, the value return has the value and ok is set to true. If there are no values for the given key, value is "" and ok is false. If you need access to multiple values, use the map directly.

func (Args) MarshalJSON Uses

func (a Args) MarshalJSON() ([]byte, error)

func (*Args) UnmarshalJSON Uses

func (a *Args) UnmarshalJSON(data []byte) error

type Client Uses

type Client struct {
    Proxy   string   `json:"proxy"`
    Methods []string `json:"methods"`


func (*Client) Start Uses

func (s *Client) Start() error

Start starts the client process, returns error if start up failes

type Config Uses

type Config struct {
    Command          string `json:"command"`
    StateLocation    string `json:"statelocation"`
    ExitOnStdinClose bool   `json:"exitonstdinclose"`
    // contains filtered or unexported fields

func (*Config) Kill Uses

func (c *Config) Kill() error

Kill terminates the transport process

func (*Config) Method Uses

func (c *Config) Method(methodName string) (MethodState, error)

Method returns one method of requested name, error if no method was found.

func (*Config) Methods Uses

func (c *Config) Methods() []MethodState

Methods returns all currently started methods

func (*Config) Wait Uses

func (c *Config) Wait() error

Wait waits until the transport process has shut down.

type MethodState Uses

type MethodState struct {
    Name    string
    Addr    *net.TCPAddr
    Options Args

// A combination of a method name and an address, as extracted from

type PTDialMethodConfig Uses

type PTDialMethodConfig struct {
    Args       Args `json:"args"`
    ClientAddr string
    ServerAddr string

PTDialMethodConfig creates proxy dails for using PT client/severs

func (PTDialMethodConfig) ClientDialer Uses

func (p PTDialMethodConfig) ClientDialer() (proxy.Dialer, error)

ClientDailer returns an socks5 proxy dialer for the pluggable transport client connection

func (PTDialMethodConfig) ServerSocksDialer Uses

func (p PTDialMethodConfig) ServerSocksDialer() (proxy.Dialer, error)

ClientDailer returns an socks5 proxy dialer relevant if the other end of the pluggable transport server is also an socks5 proxy, in that case this proxy dialer can be used to access the internet.

type SMethod Uses

type SMethod struct {
    MethodName string `json:"name"`
    BindAddr   string `json:"bindaddr"`
    Args       Args   `json:"args"`

Represents a server transport plugin configuration like:

	ServerTransportPlugin MethodName exec Command
 ServerTransportPlugin <transports> exec <path> [<options>]

type Server Uses

type Server struct {
    Methods      []SMethod `json:"methods"`
    ExtendedPort string    `json:"extport"`
    ORPort       string    `json:"orport"`

ServerConfig .

func (*Server) Start Uses

func (s *Server) Start() error

Start starts the pluggable transport server process, returns error if start up fails.

Package ptc imports 15 packages (graph) and is imported by 2 packages. Updated 2016-07-31. Refresh now. Tools for package owners.