Documentation ¶
Index ¶
- Variables
- func AddCertPermission(KeyFile, CertFile, TokenFile string, in *os.File) error
- func Examine(ctx context.Context, NetConfig *util.ClientConfig, Address string) error
- func ExamineWithTimeout(ctx context.Context, NetConfig *util.ClientConfig, Address string, ...) error
- func Execute()
- func ForwardTCP(RuntimeContext context.Context, NetConfig *util.ClientConfig, ...) error
- 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 GenerateEd25519()
- func GenerateToken() error
- func GenerateWebhookHashToken(Token string) string
- func InvokeEndpointService(ctx context.Context, NetConfig *util.ClientConfig, Channel string, ...) (string, error)
- func PrepareConfigFiles(RouterAddress string, CAFolder string, ServerDNS string, TokenFile string, ...) (map[string][]byte, 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 StartProxyClient(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func StartProxyClientWithListener(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, ...) error
- func StartProxyForwarding(RuntimeContext context.Context, NetConfig *util.ClientConfig, ...) error
- func StartRouter(NetConfig *util.ClientConfig, AddressOverride string) error
- func StartRouterWithListener(listener net.Listener, TokenFile string, TLSConfig *tls.Config) error
- type ClientSession
- type ProxyRequest
- type ProxyResponse
Constants ¶
This section is empty.
Variables ¶
var ( // ProdEnv indicates if it is in a production env. ProdEnv = true )
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 ExamineWithTimeout ¶ added in v0.0.39
func ExamineWithTimeout(ctx context.Context, NetConfig *util.ClientConfig, Address string, Timeout time.Duration) error
ExamineWithTimeout keeps trying to probe `Channel` until `Timeout`. If it will return nil immeidately on probing succeed.
func ForwardTCP ¶ added in v0.0.37
func ForwardTCP(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel, RemoteAddr string, LocalListener net.Listener) error
ForwardTCP forwards requests from `LocalListener` to `RemoteAddr`.
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 GenerateEd25519 ¶ added in v0.0.39
func GenerateEd25519()
GenerateEd25519 creates a pair of Ed25519 and output to console.
func GenerateToken ¶ added in v0.0.39
func GenerateToken() error
GenerateToken generates a pair of tokens for webhook authentication to output.
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 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 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 StartProxyClient ¶ added in v0.0.39
func StartProxyClient(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel string, LocalAddress string) error
StartProxyClient creates a local socks5 service, and forward traffic to proxy server on `Channel`.
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 StartProxyForwarding ¶ added in v0.0.37
func StartProxyForwarding(RuntimeContext context.Context, NetConfig *util.ClientConfig, Channel, LocalAddr, RemoteAddr string) error
StartProxyForwarding mounts a channel to a local address.
func StartRouter ¶ added in v0.0.16
func StartRouter(NetConfig *util.ClientConfig, AddressOverride string) error
StartRouter creates a router service.
Types ¶
type ClientSession ¶ added in v0.0.34
type ClientSession struct {
Conn io.ReadWriteCloser
}
ClientSession abtracts all the operations on a client connection.
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.