Documentation ¶
Overview ¶
Package plugin is a Caddy HTTP plugin that implements the SSTP protocol. This requires pppd to bridge the connection through SSTP.
Index ¶
Constants ¶
const ( HandshakeLengthOriginal = "Content-Length: 18446744073709551615" HandshakeLengthReplaced = "Content-Length: 9223372036854775807 " )
The string to find and replace within SSTP handshakes.
const ( MethodCheckString = "SSTP" MethodCheckLen = len(MethodCheckString) )
The string to verify from the start of the request, to check that it is a SSTP handshake.
const MethodSstp = "SSTP_DUPLEX_POST"
MethodSstp is the SSTP handshake's HTTP method.
const RequestPath = "/sra_{BA195980-CD49-458b-9E23-C84EE0ADCD75}/"
RequestPath is the path that the SSTP handshake uses.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeID ¶
type AttributeID uint8
AttributeID is the type of attribute this attribute is
const ( AttributeIDEncapsulatedProtocolID AttributeID = 1 AttributeIDStatusInfo AttributeID = 2 AttributeIDCryptoBinding AttributeID = 3 AttributeIDCryptoBindingReq AttributeID = 4 )
Constants for AttributeID values
func (AttributeID) String ¶
func (k AttributeID) String() string
type MessageType ¶
type MessageType uint16
MessageType is the type of message this packet is
const ( MessageTypeCallConnectRequest MessageType = 1 MessageTypeCallConnectAck MessageType = 2 MessageTypeCallConnectNak MessageType = 3 MessageTypeCallConnected MessageType = 4 MessageTypeCallAbort MessageType = 5 MessageTypeCallDisconnect MessageType = 6 MessageTypeCallDisconnectAck MessageType = 7 MessageTypeEchoRequest MessageType = 8 MessageTypeEchoResponse MessageType = 9 )
Constants for MessageType values
func (MessageType) String ¶
func (k MessageType) String() string
type Server ¶
type Server struct { NextHandler httpserver.Handler // contains filtered or unexported fields }
Server is a httpserver.Handler that handles SSTP requests.
type WrappedConn ¶
WrappedConn is a wrapper around a net.Conn that modifies SSTP requests.
func (*WrappedConn) Read ¶
func (c *WrappedConn) Read(b []byte) (int, error)
Overrides net.Conn.Read to modify SSTP requests.
This is needed as SSTP handshakes use a Content-Length greater than an int64, so it must be modified to be compatible.
This currently only works on HTTP requests, as we currently have no way intercept after SSL decryption.
This function is passive: it will not read more bytes than c.Conn.Read reads, and will modify them if it is needed.