action

package
v0.0.0-...-88b4fc5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientCmd = cli.Command{
	Name:    "client",
	Aliases: []string{"cli"},
	Usage:   "start a client",
	Action:  StartClient,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "protocol, p",
			Value: "udp",
			Usage: "server protocol, support udp & quic",
		},

		&cli.StringFlag{
			Name:  "address, addr",
			Value: "127.0.0.1:8888",
			Usage: "server protocol, support udp & quic",
		},
	},
}
View Source
var CodecCmd = cli.Command{
	Name:    "codec",
	Aliases: []string{"codec"},
	Usage:   "parse packet for pointed protocol",
	Action:  StartCodec,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "protocol, p",
			Value: "quic",
			Usage: "server protocol, support:" + server.DisplayProtocols(),
		},
		&cli.StringFlag{
			Name:  "file, f",
			Value: "./data.txt",
			Usage: "data file path",
		},
	},
}
View Source
var ProxyCmd = cli.Command{
	Name:    "proxy",
	Aliases: []string{"proxy"},
	Usage:   "start a proxy in ip protocol",
	Action:  StartProxy,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "host",
			Value: "0.0.0.0",
			Usage: "proxy host, default: 0.0.0.0",
		},
		cli.StringFlag{
			Name:  "port, p",
			Value: "8887",
			Usage: "proxy port, default: 8887",
		},
		cli.StringFlag{
			Name:  "file_port, fp",
			Value: "8886",
			Usage: "file server port, default:8886",
		},
		cli.IntFlag{
			Name:  "type, t",
			Value: 0,
			Usage: "proxy type, default: 0(socks5)",
		},
	},
}
View Source
var ServerCmd = cli.Command{
	Name:    "server",
	Aliases: []string{"ser"},
	Usage:   "start a server",
	Action:  StartServer,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "protocol, p",
			Value: "udp",
			Usage: "server protocol, support:" + server.DisplayProtocols(),
		},
		&cli.StringFlag{
			Name:  "address, addr",
			Value: "0.0.0.0:8888",
			Usage: "server address",
		},
		&cli.StringFlag{
			Name:  "handler, hd",
			Value: string(server.HEcho),
			Usage: "server handler, support:" + server.DisplayHandlers(),
		},
		&cli.StringFlag{
			Name:  "server_type, st",
			Value: "default",
			Usage: "server type, support:",
		},
	},
}

Functions

func StartClient

func StartClient(c *cli.Context) error

func StartCodec

func StartCodec(c *cli.Context) error

func StartProxy

func StartProxy(ctx *cli.Context) error

func StartServer

func StartServer(c *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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