proto

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package proto defines tunnel client server communication protocol.

Index

Constants

View Source
const (
	// ControlPath is http.Handler url path for control connection.
	ControlPath = "/_controlPath/"

	// ClientIdentifierHeader is header carrying information about tunnel identifier.
	ClientIdentifierHeader = "X-KTunnel-Identifier"

	// Connected is message sent by server to client when control connection was established.
	Connected = "200 Connected to Tunnel"
	// HandshakeRequest is hello message sent by client to server.
	HandshakeRequest = "controlHandshake"
	// HandshakeResponse is response to HandshakeRequest sent by server to client.
	HandshakeResponse = "controlOk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action represents type of ControlMsg request.

const (
	RequestClientSession Action = iota + 1
)

ControlMessage actions.

type ControlMessage

type ControlMessage struct {
	Action    Action `json:"action"`
	Protocol  Type   `json:"transportProtocol"`
	LocalPort int    `json:"localPort"`
}

ControlMessage is sent from server to client to establish tunneled connection.

type Type

type Type int

Type represents tunneled connection type.

const (
	HTTP Type = iota + 1
	TCP
	WS
)

ControlMessage protocols.

Jump to

Keyboard shortcuts

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