pinggy

package module
v0.0.0-...-0429b5e Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 11 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

This section is empty.

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

	/*
		This module log several thing. We use the Logger for this task. If Logger is `nil`, we use the default Logger.
	*/
	Logger *log.Logger

	/*
		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 PinggyListener added in v0.0.3

type PinggyListener interface {
	net.Listener

	RemoteUrls() []string

	InitiateWebDebug(addr string) error

	/*
	 */
	StartShell() error

	/*
		Start a webserver.
	*/
	ServeHttp(handler http.Handler) error

	/*
		Start a web server and serve file.
	*/
	ServerFileOverHttp(fs http.FileSystem) error

	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"
	TLSTCP TunnelType = "tlstcp"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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