sshbridge

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sshbridge lets xray-core use an SSH server as its proxy.

xray-core has no SSH outbound, so Kite runs a tiny SOCKS5 server on 127.0.0.1 that forwards each CONNECT through one SSH session (direct-tcpip channels, like `ssh -D`). The generated xray config then points its proxy outbound at that SOCKS port. SSH carries TCP only: UDP ASSOCIATE is refused, and DNS is resolved over TCP instead (see xrayconf).

SSH servers use protocol "ssh" with Password and these extra keys: user, pk (private key, PEM/OpenSSH), pp (key passphrase) and hk (host key: "SHA256:..." fingerprint or an authorized_keys line; empty = don't verify).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	Port int
	// contains filtered or unexported fields
}

Bridge is a running local SOCKS5 -> SSH forwarder.

func Start

func Start(s profile.Server) (*Bridge, error)

Start connects to the SSH server (failing fast on bad credentials) and starts the local SOCKS5 listener.

func (*Bridge) Close

func (b *Bridge) Close()

Close stops the listener and the SSH session. Safe on nil.

Jump to

Keyboard shortcuts

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