cmd

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YamuxFlagLongName                          = "yamux"
	PmuxFlagLongName                           = "pmux"
	PmuxConfigFlagLongName                     = "pmux-config"
	SymmetricallyEncryptsFlagLongName          = "symmetric"
	SymmetricallyEncryptsFlagShortName         = "c"
	SymmetricallyEncryptPassphraseFlagLongName = "pass"
	CipherTypeFlagLongName                     = "cipher-type"
	Pbkdf2FlagLongName                         = "pbkdf2"
)
View Source
const DefaultCipherType = piping_util.CipherTypeAesCtr
View Source
const (
	ServerUrlEnvName = "PIPING_SERVER"
)
View Source
const YamuxMimeType = "application/yamux"

Variables

View Source
var DnsServer string
View Source
var HeaderKeyValueStrs []string
View Source
var HttpReadBufSize int
View Source
var HttpWriteBufSize int
View Source
var Insecure bool
View Source
var RootCmd = &cobra.Command{
	Use:          os.Args[0],
	Short:        "piping-tunnel",
	Long:         "Tunneling from anywhere with Piping Server",
	SilenceUsage: true,
	Example: fmt.Sprintf(`
Normal:
  piping-tunnel server -p 22 aaa bbb
  piping-tunnel client -p 1022 aaa bbb

Short:
  piping-tunnel server -p 22 mypath
  piping-tunnel client -p 1022 mypath

Multiplexing:
  piping-tunnel server -p 22 --yamux aaa bbb
  piping-tunnel client -p 1022 --yamux aaa bbb

SOCKS proxy like VPN:
  piping-tunnel socks --yamux aaa bbb
  piping-tunnel client -p 1080 --yamux aaa bbb

Environment variable:
  $%s for default Piping Server
`, ServerUrlEnvName),
	RunE: func(cmd *cobra.Command, args []string) error {
		if showsVersion {
			fmt.Println(version.Version)
			return nil
		}
		return cmd.Help()
	},
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		Vlog.Level = verboseLoggerLevel
	},
}
View Source
var ServerUrl string
View Source
var ShowProgress bool

Functions

func ExamplePbkdf2JsonStr added in v0.10.0

func ExamplePbkdf2JsonStr() string

func GeneratePaths added in v0.10.0

func GeneratePaths(args []string) (string, string, error)

func HeadersWithYamux added in v0.10.0

func HeadersWithYamux(headers []piping_util.KeyValue) []piping_util.KeyValue

func MakeDuplexWithEncryptionAndProgressIfNeed added in v0.10.0

func MakeDuplexWithEncryptionAndProgressIfNeed(duplex io.ReadWriteCloser, encrypts bool, passphrase string, cipherType string, pbkdf2JsonStr string) (io.ReadWriteCloser, error)

func MakeProgressMessage added in v0.10.0

func MakeProgressMessage(progress *io_progress.IOProgress) string

func MakeUserInputPassphraseIfEmpty added in v0.10.0

func MakeUserInputPassphraseIfEmpty(passphrase *string) (err error)

func ValidateClientCipher added in v0.10.0

func ValidateClientCipher(str string) error

Types

type ClientPmuxConfigJson added in v0.10.0

type ClientPmuxConfigJson struct {
	Hb bool `json:"hb"`
}

type OpensslAesCtrParams added in v0.10.0

type OpensslAesCtrParams struct {
	KeyBits uint16
	Pbkdf2  *Pbkdf2Config
}

func ParseOpensslAesCtrParams added in v0.10.0

func ParseOpensslAesCtrParams(cipherType string, pbkdf2ConfigJsonStr string) (*OpensslAesCtrParams, error)

type Pbkdf2Config added in v0.10.0

type Pbkdf2Config struct {
	Iter                   int
	Hash                   func() hash.Hash
	HashNameForCommandHint string // for command hint
}

func ParsePbkdf2 added in v0.10.0

func ParsePbkdf2(str string) (*Pbkdf2Config, error)

type ServerPmuxConfigJson added in v0.10.0

type ServerPmuxConfigJson struct {
	Hb bool `json:"hb"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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