pinggy

package
v0.0.0-...-1bbbccf Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeFile

func ServeFile(path string)

func ServeFileWithConfig

func ServeFileWithConfig(conf FileServerConfig)

func ServeFileWithToken

func ServeFileWithToken(token string, path string)

Types

type AltTunnelType

type AltTunnelType string
const (
	UDP AltTunnelType = "udp"
)

type Config

type Config struct {
	/*
		Token is a string. It identify an user. You can find a token at the https://dashboard.pinggy.io.
		Token is required to connect in TCP and TLS tunnel.
	*/
	Token string

	/*
		Tunnel type. It can be one of TCP or TLS or HTTP or empty.
		Both type and altType cannot be empty.
	*/
	Type TunnelType

	/*
		Alternate AltTunnelType. It can be UDP or empty. However,
		both type and altType cannot be empty. As of now only one of
		them can be populated.
	*/
	AltType AltTunnelType

	/*
		Pinggy supports ssh over ssl when user is behind a firewall which does not allow anything but ssl.
		Simply enable this flag and this package would take care of this problem.
	*/
	SshOverSsl bool
	/*
		Pinggy server to connect to. Default value `a.pinggy.io`.
		Users are discouraged to use this.
	*/
	Server string
	// contains filtered or unexported fields
}

type FileServerConfig

type FileServerConfig struct {
	Conf            Config
	Path            string
	Fs              fs.FS
	WebDebugEnabled bool
	WebDebugPort    int
}

type PinggyListener

type PinggyListener interface {
	net.Listener
	net.PacketConn

	/*
		Return the remote urls to access the tunnels.
	*/
	RemoteUrls() []string

	/*
		Start webdebugger. This can not be call multiple time. Once the debugger started, it cannot be closed.
		Also, the debugger is not available in case of `tls` and `tcp` tunnel
	*/
	InitiateWebDebug(addr string) error

	/*
		Start a webserver.
	*/
	ServeHttp(fs fs.FS) error
}

func Connect

func Connect() (PinggyListener, error)

func ConnectTcp

func ConnectTcp(token string) (PinggyListener, error)

func ConnectTls

func ConnectTls(token string) (PinggyListener, error)

func ConnectToken

func ConnectToken(token string) (PinggyListener, error)

func ConnectWithConfig

func ConnectWithConfig(conf Config) (PinggyListener, error)

type TunnelType

type TunnelType string
const (
	TCP  TunnelType = "tcp"
	TLS  TunnelType = "tls"
	HTTP TunnelType = "http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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