Documentation
¶
Index ¶
- Constants
- Variables
- func SerializedTAPReader(ctx context.Context, tap *water.Interface, wg *sync.WaitGroup) (<-chan []byte, <-chan error)
- func SerializedTAPWriter(ctx context.Context, tap *water.Interface, wg *sync.WaitGroup) (chan<- []byte, <-chan error)
- func SerializedWSSReader(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup) (<-chan []byte, <-chan error)
- func SerializedWSSWriter(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup) (chan<- []byte, <-chan error)
- type RoxyClient
- func (client *RoxyClient) Connect() error
- func (client *RoxyClient) Disconnect() error
- func (client *RoxyClient) IfaceName() string
- func (client *RoxyClient) LogToAll(level shared.LogLevel, msg string)
- func (client *RoxyClient) LogToDatabase(level shared.LogLevel, msg string)
- func (client *RoxyClient) LogToScreen(level shared.LogLevel, msg string)
- func (client *RoxyClient) Shutdown() error
- func (client *RoxyClient) Watchdog()
Constants ¶
const ( HKDFInfoClientToServerAESGCMSIV string = "HKDF_INFO_CLIENT_TO_SERVER_AES_GCM_SIV" HKDFInfoServerToClientAESGCMSIV string = "HKDF_INFO_SERVER_TO_CLIENT_AES_GCM_SIV" )
HKDF related
const (
AESGCMSIVKeyLenAsBytes int = 32
)
AES related
const (
ClientSideSessionSaltLen int = 16
)
Salt config
const (
KeyRotationInterval uint64 = 1 << 31 // = 2^31
)
Key rotation
Variables ¶
var ( ErrInvalidPaddingLengthConfig error = errors.New("invalid padding length config") ErrUnexpectedNoiseIKCipherStates error = errors.New("unexpected Noise IK cipher states") ErrEmptyNoiseResponse error = errors.New("empty noise response") ErrTAPNotClosedProperlyBefore error = errors.New("TAP not closed properly before") )
Errors
Functions ¶
func SerializedTAPReader ¶
func SerializedTAPWriter ¶
func SerializedTAPWriter(ctx context.Context, tap *water.Interface, wg *sync.WaitGroup) (chan<- []byte, <-chan error)
Although it has a "closed chan check", you should not close the Chan manually.
Just use context and let GC do the extra works.
func SerializedWSSReader ¶
Types ¶
type RoxyClient ¶
type RoxyClient struct {
// contains filtered or unexported fields
}
Struct RoxyClient is the struct of Roxy Client
Instance DB is a SQLite database contains everything needs, like config.
Logs are logged to this DB too, so it's easy to move everything to another machine without any pain.
You don't need to close any chan manually.
func NewRoxyClient ¶
func NewRoxyClient(instanceDB string) (*RoxyClient, error)
Create a new roxy client instance from a specified instance DB.
func (*RoxyClient) Connect ¶
func (client *RoxyClient) Connect() error
TODO: Use Noise IK message to auth. TODO: Support pluggable auth. FIXME: Remove Bearer Auth Related.
func (*RoxyClient) Disconnect ¶
func (client *RoxyClient) Disconnect() error
func (*RoxyClient) LogToDatabase ¶
func (client *RoxyClient) LogToDatabase(level shared.LogLevel, msg string)
func (*RoxyClient) LogToScreen ¶
func (client *RoxyClient) LogToScreen(level shared.LogLevel, msg string)
func (*RoxyClient) Shutdown ¶
func (client *RoxyClient) Shutdown() error
After Shutdown, the related object should be DROPPED, do NOT reuse it!
func (*RoxyClient) Watchdog ¶
func (client *RoxyClient) Watchdog()
Do NOT start watchdog with client.linkWorkersWG.Go()!