sshproxy

package
v0.0.0-...-f80b70b Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	ReTime        int64 = 10 // 连接异常次数后重新打开的等待时间
	HeartBeatTime int64 = 3  // 心跳检测周期

)

Functions

func StartAction

func StartAction(addrs []Connect)
Example
var item = Connect{
	Saddr:       "39.105.141.168:22",
	User:        "root",
	SshAuthType: 2,
	Passwd:      "D:\\34903\\Documents\\abserari.pem",
	Remote:      "172.18.0.2:8080",
	Listen:      "127.0.0.1:8080",
	Connect:     "L",
}
StartAction([]Connect{item})
select {}
Output:

Types

type Connect

type Connect struct {
	Saddr       string    `json:"saddr"`    // 目标地址
	User        string    `json:"user"`     // 用户
	SshAuthType int       `json:"authType"` // 验证方式 1、密码验证 2、密钥验证
	Passwd      string    `json:"passwd"`   // 密码、密钥路径
	Remote      string    `json:"remote"`   // 远程地址
	Listen      string    `json:"listen"`   // 本地监听地址
	Connect     string    `json:"connect"`  // 连接类型 L 本地转发 R 远程转发 D 动态转发
	Son         []Connect `json:"son"`      // 子连接
	// contains filtered or unexported fields
}

{ "saddr":"120.28.22.113:22", // 远程转发 "user": "root", "type": 2, "passwd": ".ssh/auth", "Connect": "R", "remote": "127.0.0.1:12345", "listen": "127.0.0.1:12345" }, { "saddr":"120.28.22.113:22", // 本地转发 "user": "root", "type": 1, "passwd": "test12345", "connect": "L", "remote": "120.28.23.113:22", "listen": "127.0.0.1:6001", "son": [ { "saddr":"127.0.0.1:6001", // 动态转发 "user": "root", "type": 2, "passwd": ".ssh/auth_key", "connect": "D", "listen": "127.0.0.1:60122" } ] }

Jump to

Keyboard shortcuts

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