wstun

package module
v0.0.0-...-14c6e11 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

README

wstun

A scary SSH SOCKS5 tunnel through websockets. wstun can be used to tunnel a TCP connection through a (corporate) http proxy via SOCKS5. The application data is tunneled through an SSH connection within the websocket connection. Clients are registered using the authorized_keys mechanism known from other SSH implementations.

application ------ wstun ------ http proxy ---- wstund ----- target

SOCKS5 <-> SSH over Websocket <-> target

Server

$ ./wstund

By default wstund listens on port 8000 and expects an SSD ED25519 key at ~/.config/wstund/id_ed25519. The key can be generated with ssh-keygen -t ed25519. The tunnel endpoint is by default at /tunnel. Put the public key of allowed clients into ~/.config/wstund/authorized_keys.

Client

$ wstun ws://example.org/tunnel

wss can be used if you use https. wstun supports http proxies via the common environment variables (e.g. http_proxy) out of the box. A local SOCKS server is exposed at 127.0.0.1:1080 which can be used via setting all_proxy=socks5://localhost:1080. Alternativly, the proxy settings may be configured directly in the application, for instance firefox.

Similar to the server, the client expects an ssh key at ~/.config/wstun/id_ed25519.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAuthorizedKeys

func ReadAuthorizedKeys(path string) (map[string]ssh.PublicKey, error)

func ReadPrivateKey

func ReadPrivateKey(path string) (ssh.Signer, error)

Types

type WSTransportWrapper

type WSTransportWrapper struct {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

func NewWSTransportWrapper

func NewWSTransportWrapper(conn *websocket.Conn) *WSTransportWrapper

func (*WSTransportWrapper) Close

func (t *WSTransportWrapper) Close() error

func (*WSTransportWrapper) LocalAddr

func (t *WSTransportWrapper) LocalAddr() net.Addr

func (*WSTransportWrapper) Read

func (t *WSTransportWrapper) Read(p []byte) (int, error)

func (*WSTransportWrapper) RemoteAddr

func (t *WSTransportWrapper) RemoteAddr() net.Addr

func (*WSTransportWrapper) SetDeadline

func (t *WSTransportWrapper) SetDeadline(ti time.Time) error

func (*WSTransportWrapper) SetReadDeadline

func (t *WSTransportWrapper) SetReadDeadline(ti time.Time) error

func (*WSTransportWrapper) SetWriteDeadline

func (t *WSTransportWrapper) SetWriteDeadline(ti time.Time) error

func (*WSTransportWrapper) Write

func (t *WSTransportWrapper) Write(p []byte) (int, error)

Directories

Path Synopsis
bin

Jump to

Keyboard shortcuts

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