package tunnel
import "github.com/moby/vpnkit/go/pkg/tunnel"
Index ¶
- Constants
- func MarshalForwards(all []Forward) ([]byte, error)
- type Forward
- type Protocol
- type Request
- type Response
Constants ¶
const EveryPort = 0 // EveryPort should be sent through the tunnel
Functions ¶
func MarshalForwards ¶
MarshalForwards returns a forwards specification in json format.
Types ¶
type Forward ¶
type Forward struct { Protocol Protocol // Protocol to be forwarded. DstPrefix *net.IPNet // Traffic matching this network prefix will be sent via the tunnel. DstPort int // Traffic with this destination port will be sent via the tunnel. Path string // Path of the tunnel server. }
Forward traffic for the given IP destination to the tunnel server on the Unix domain socket path.
func UnmarshalForwards ¶
UnmarshalForwards returns a parsed forwards specification.
type Protocol ¶
type Protocol string
type Request ¶
type Request struct { Protocol Protocol DstIP net.IP // DstIP is the Destination IP address. DstPort int // DstPort is the Destination Port. SrcIP net.IP // SrcIP is the Source IP address. SrcPort int // SrcPort is the Source Port. }
Request to open a tunnel.
func ReadRequest ¶
ReadRequest from vpnkit to open a tunnel to a remote service.
func (*Request) Write ¶
WriteRequest to vpnkit to open a tunnel to a remote service.
type Response ¶
type Response struct { Accepted bool `json:"accepted"` // Accepted is true if the tunnel is now connected. }
Response to the tunnel open request.
func ReadResponse ¶
func (*Response) Write ¶
Source Files ¶
- Version
- v0.6.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 14 hours ago –
Tools for package owners.