Documentation ¶
Overview ¶
Package forward_tcp forwards TCP traffic.
Index ¶
- func DialRemoteLoop(n point_c.Net, dstPort uint16, pairs <-chan *ConnPair, dialed chan<- *ConnPair)
- func ListenLoop(ln net.Listener, conns chan<- net.Conn)
- func PrepareConnPairLoop(ctx context.Context, logger *slog.Logger, conns <-chan net.Conn, ...)
- func StartCopyLoop(pairs <-chan *ConnPair, ...)
- func TcpCopy(done func(), logger *slog.Logger, dst io.Writer, src io.Reader, buf []byte)
- type BufSize
- type ConnPair
- type ForwardTCP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialRemoteLoop ¶
DialRemoteLoop is responsible for dialing the receiver.
func ListenLoop ¶
ListenLoop accepts connections and sends them to the next operation.
func PrepareConnPairLoop ¶
func PrepareConnPairLoop(ctx context.Context, logger *slog.Logger, conns <-chan net.Conn, pairs chan<- *ConnPair)
PrepareConnPairLoop initializes the forwarding session.
Types ¶
type BufSize ¶
type BufSize = configvalues.CaddyTextUnmarshaler[uint64, configvalues.ValueUnsigned[uint64], *configvalues.ValueUnsigned[uint64]]
type ConnPair ¶
type ConnPair struct { Ctx context.Context Cancel context.CancelFunc Remote net.Conn Tunnel net.Conn Logger *slog.Logger }
ConnPair helps manage the state of a forwarding session.
func (*ConnPair) DialTunnel ¶
DialTunnel does the actual remote dialing.
type ForwardTCP ¶
type ForwardTCP struct { Ports configvalues.PortPair `json:"ports"` BufSize BufSize `json:"buf"` // contains filtered or unexported fields }
ForwardTCP is able to forward TCP traffic through networks.
func (*ForwardTCP) CaddyModule ¶
func (f *ForwardTCP) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*ForwardTCP) Cleanup ¶
func (f *ForwardTCP) Cleanup() error
Cleanup implements caddy.CleanerUpper.
func (*ForwardTCP) Provision ¶
func (f *ForwardTCP) Provision(ctx caddy.Context) error
Provision implements caddy.Provisioner.
func (*ForwardTCP) Start ¶
func (f *ForwardTCP) Start(n *forward.ForwardNetworks) error
Start implements [ForwardProto]. It is responsible for starting the forwarding of network traffic.
func (*ForwardTCP) UnmarshalCaddyfile ¶
func (f *ForwardTCP) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile unmarshals the caddyfile. Buffer size is the size of the buffer to use per stream direction. Buffer size will be double the specified amount per connection. ```
point-c netops { forward <src network name>:<dst network name> { tcp <src port>:<dst port> [buffer size] } }
```