Documentation ¶
Index ¶
- Variables
- func AddCertPermission(KeyFile, CertFile, TokenFile string, in *os.File) error
- func Execute()
- func GenerateCA(CertName string, OutputFolder string, Length int) error
- func GenerateCertificate(CertName string, DNSName string, CAFolder string, OutputFolder string, ...) error
- func GenerateConfigToFolder(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ...) error
- func GenerateConfigZip(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ...) error
- func GenerateWebhookHashToken(Token string) string
- func InvokeEndpointService(ctx context.Context, NetConfig *util.ClientConfig, Channel string, ...) (string, error)
- func MountBatch(RuntimeContext context.Context, NetConfig *util.ClientConfig, ...) error
- func MountLoadBalancing(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func MountLocal(RuntimeContext context.Context, NetConfig *util.ClientConfig, ...) error
- func MountLocalListener(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func MountRemote(RuntimeContext context.Context, NetConfig *util.ClientConfig, ...) error
- func PrepareConfigFiles(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ...) (map[string][]byte, string, error)
- func Probe(ctx context.Context, NetConfig *util.ClientConfig, Address string) error
- func ProbeWithTimeout(ctx context.Context, NetConfig *util.ClientConfig, Address string, ...) error
- func StartDynamicProxy(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string) error
- func StartEndpointService(ctx context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func StartEndpointWebhookProxy(ctx context.Context, NetConfig *util.ClientConfig, LocalAddr, HashToken string) error
- func StartProxyClientWithListener(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func StartRouter(NetConfig *util.ClientConfig, AddressOverride string) error
- func StartRouterWithListener(listener net.Listener, TokenFile string, TLSConfig *tls.Config) error
- type BatchMountConfig
- type ClientSession
- type LoadBalancingConfig
- type MountConfig
- type ProxyRequest
- type ProxyResponse
Constants ¶
This section is empty.
Variables ¶
var ( // Version is the version number of this program, should be populated while building. Version string )
Functions ¶
func AddCertPermission ¶ added in v0.0.16
AddCertPermission adds a new ACL rule into `TokenFile` for clients using `CertFile` and `KeyFile`.
func GenerateCA ¶ added in v0.0.16
GenerateCA generates a CA with `CertName` as its common name, and stores `ca.key` and `ca.cert` into `OutputFolder`.
func GenerateCertificate ¶ added in v0.0.16
func GenerateCertificate(CertName string, DNSName string, CAFolder string, OutputFolder string, Length int) error
GenerateCertificate generates a certificate signed by CA stored in `CAFolder`.
func GenerateConfigToFolder ¶ added in v0.0.16
func GenerateConfigToFolder(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, OutputFolder string, ConfigBaseFolderOverride string, Length int, RouterName string) error
GenerateConfigToFolder generates configs into the Output folder.
func GenerateConfigZip ¶ added in v0.0.16
func GenerateConfigZip(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ConfigFile string, ConfigBaseFolderOverride string, Length int, RouterName string) error
GenerateConfigZip generates a zip file including a whole set of configuration required to connect to yukino-net.
func GenerateWebhookHashToken ¶ added in v0.0.16
GenerateWebhookHashToken creates a salted token as a webhook server side token.
func InvokeEndpointService ¶ added in v0.0.16
func InvokeEndpointService(ctx context.Context, NetConfig *util.ClientConfig, Channel string, Command []string, PrivateKey string, timeout time.Duration) (string, error)
InvokeEndpointService invokes an endpoint service serving on `Channel`. `PrivateKey` can be empty if authenticaiton is not set on the server side.
func MountBatch ¶ added in v0.0.28
func MountBatch(RuntimeContext context.Context, NetConfig *util.ClientConfig, BatchConfigFile string) error
MountBatch parses a config file in format `BatchMountConfig`. And do a series of mounting operations.
func MountLoadBalancing ¶ added in v0.0.25
func MountLoadBalancing(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, RemoteChannel []string) error
MountLoadBalancing evenly distributes connections from `Channel` to `RemoteChannel`.
func MountLocal ¶ added in v0.0.16
func MountLocal(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel, LocalAddr string) error
MountLocal mountes a channel to a local address.
func MountLocalListener ¶ added in v0.0.16
func MountLocalListener(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, LocalListener net.Listener) error
MountLocalListener mounts a channel to a listener.
func MountRemote ¶ added in v0.0.16
func MountRemote(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel, RemoteAddr string) error
MountRemote mountes a remote address as a `channel` on yukino-net.
func PrepareConfigFiles ¶ added in v0.0.16
func PrepareConfigFiles(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ConfigBaseFolderOverride string, Length int, RouterCertName string) (map[string][]byte, string, error)
PrepareConfigFiles generates a config set in map[filename] = filedata format.
func ProbeWithTimeout ¶ added in v0.0.34
func ProbeWithTimeout(ctx context.Context, NetConfig *util.ClientConfig, Address string, Timeout time.Duration) error
ProbeWithTimeout keeps trying to probe `Channel` until `Timeout`. If it will return nil immeidately on probing succeed.
func StartDynamicProxy ¶ added in v0.0.34
func StartDynamicProxy(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string) error
StartDynamicProxy creates a dynamic proxy server for the client to do TCP/UDP proxy requests.
func StartEndpointService ¶ added in v0.0.16
func StartEndpointService(ctx context.Context, NetConfig *util.ClientConfig, Channel string, ACL []string, BaseCommand string) error
StartEndpointService starts an endpoint service listening on `Channel`.
func StartEndpointWebhookProxy ¶ added in v0.0.16
func StartEndpointWebhookProxy(ctx context.Context, NetConfig *util.ClientConfig, LocalAddr, HashToken string) error
StartEndpointWebhookProxy creates a web service that can proxy an endpoint invoke.
func StartProxyClientWithListener ¶ added in v0.0.34
func StartProxyClientWithListener(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, LocalAddress string, listener net.Listener) error
StartProxyClientWithListener starts a socks5 proxy on `listener`.
func StartRouter ¶ added in v0.0.16
func StartRouter(NetConfig *util.ClientConfig, AddressOverride string) error
StartRouter creates a router service.
Types ¶
type BatchMountConfig ¶ added in v0.0.28
type BatchMountConfig struct { MountConfigs []MountConfig `json:"mount-configs"` LoadBalancingConfig []LoadBalancingConfig `json:"load-balancers"` }
BatchMountConfig specifies a local file to define a set of operations.
type ClientSession ¶ added in v0.0.34
type ClientSession struct {
Conn io.ReadWriteCloser
}
ClientSession abtracts all the operations on a client connection.
type LoadBalancingConfig ¶ added in v0.0.28
type LoadBalancingConfig struct { LoadBalancingChannel string `json:"load-balancer-channel"` Channels []string `json:"channels"` }
LoadBalancingConfig specifies a load balancer above channels.
type MountConfig ¶ added in v0.0.28
type MountConfig struct { Channel string `json:"channel"` Address string `json:"address"` // Should only be `remote` or `local`. Type string `json:"type"` }
MountConfig specifies a mount option.
type ProxyRequest ¶ added in v0.0.34
ProxyRequest defines a request structure by proxy client.
type ProxyResponse ¶ added in v0.0.34
ProxyResponse defines a response structure by proxy server.