cmd

package
v0.0.0-...-0332759 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = &cobra.Command{
	Use:   "dctor <command>",
	Short: "Tor proxy for DC network",
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		fmt.Println("Starting Tor node...")
		var dw io.Writer
		if debug, _ := cmd.Flags().GetBool("debug"); debug {
			dw = os.Stderr
		}
		dataDir, _ := cmd.Flags().GetString("data")
		t, err := tor.Start(nil, &tor.StartConf{
			DataDir:        dataDir,
			ProcessCreator: ltor.Creator,
			DebugWriter:    dw,
		})
		if err != nil {
			return fmt.Errorf("failed to start Tor: %v", err)
		}
		Tor = t
		return nil
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		if Tor != nil {
			_ = Tor.Close()
		}
	},
}
View Source
var Tor *tor.Tor

Functions

This section is empty.

Types

type ClientProxy

type ClientProxy struct {
	// contains filtered or unexported fields
}

func NewClientProxy

func NewClientProxy(onion string, d *tor.Dialer, torHub string) (*ClientProxy, error)

func (*ClientProxy) Serve

func (p *ClientProxy) Serve(l net.Listener) error

func (*ClientProxy) ServeConn

func (p *ClientProxy) ServeConn(conn net.Conn) error

func (*ClientProxy) ServeTor

func (p *ClientProxy) ServeTor(l net.Listener) error

func (*ClientProxy) ServeTorConn

func (p *ClientProxy) ServeTorConn(conn net.Conn) error

type HubProxy

type HubProxy struct {
	// contains filtered or unexported fields
}

func NewHubProxy

func NewHubProxy(addr string) (*HubProxy, error)

func (*HubProxy) Serve

func (p *HubProxy) Serve(l net.Listener) error

func (*HubProxy) ServeConn

func (p *HubProxy) ServeConn(conn net.Conn) error

Jump to

Keyboard shortcuts

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