Documentation
¶
Overview ¶
Package portal provides the ability to build a 2-node HTTP tunnel
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Logf is for setting logging function Logf func(string, ...interface{}) )
Functions ¶
func TunnelServe ¶
func TunnelServe(ctx context.Context, c Framer, coch <-chan ConnectOperation)
TunnelServe starts the communication with the remote side with tunnel messages connection c. It handles new proxy connections coming into connection channel cch.
Types ¶
type ConnectOperation ¶ added in v0.1.5
type ConnectOperation struct {
// Hijacked HTTP connection for CONNECT method
// or a connection with HTTP CONNECT processed
Conn net.Conn
// Address section from the HTTP CONNECT line
Address string
}
ConnectOperation is for handling HTTP CONNECT request
type Framer ¶ added in v0.1.5
type Framer interface {
// Read reads a message from the connection
// The returned byte array is of the exact length of the message
Read() (b []byte, err error)
// Write writes the entire byte array as a message to the connection
Write(b []byte) error
// Close closes the connection
// Error maybe used by the underlying connection protocol
Close(err error) error
}
Framer is for reading and writing messages with boundaries (i.e. frame)
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
sample-https-client
command
|
|
|
sample-https-server
command
|
|
|
simple-tunnel
command
|
|
|
ws-tunnel
command
|
|
|
pkg
|
|
Click to show internal directories.
Click to hide internal directories.