pinggy

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 10 Imported by: 0

README

Pinggy

Pinggy provides tunneling service over ssh. It provides different types of tunnel. This module provides a easy API for Pinggy.

This module is essentially a wrapper over golang.org/x/crypto/ssh. However, it makes tunnel creation as simple as

listener, _ := pinggy.Connect()

The sdk exposes multiple helpfull APIs. It allows users to use the special feature sshOverSsl.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeFile added in v0.0.5

func ServeFile(path string)

func ServeFileWithConfig added in v0.0.5

func ServeFileWithConfig(conf FileServerConfig)

func ServeFileWithToken added in v0.0.5

func ServeFileWithToken(token string, path string)

Types

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
	*/
	Type TunnelType

	/*
		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
	// contains filtered or unexported fields
}

type FileServerConfig added in v0.0.5

type FileServerConfig struct {
	Conf            Config
	Path            string
	WebDebugEnabled bool
	WebDebugPort    int
}

type PinggyListener added in v0.0.3

type PinggyListener interface {
	net.Listener
	/*
		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
}

func Connect

func Connect() (PinggyListener, error)

func ConnectTcp added in v0.0.3

func ConnectTcp(token string) (PinggyListener, error)

func ConnectTls added in v0.0.3

func ConnectTls(token string) (PinggyListener, error)

func ConnectToken added in v0.0.3

func ConnectToken(token string) (PinggyListener, error)

func ConnectWithConfig added in v0.0.3

func ConnectWithConfig(conf Config) (PinggyListener, error)

type TunnelType added in v0.0.3

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