You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/proxy/proxy.go

33 lines
1.1 KiB

// Package proxy contains all proxies used by V2Ray.
package proxy
import (
"context"
"v2ray.com/core/app/dispatcher"
8 years ago
"v2ray.com/core/common/net"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/ray"
)
// An Inbound processes inbound connections.
type Inbound interface {
8 years ago
// Network returns a list of network that this inbound supports. Connections with not-supported networks will not be passed into Process().
Network() net.NetworkList
8 years ago
// Process processes a connection of given network. If necessary, the Inbound can dispatch the connection to an Outbound.
Process(context.Context, net.Network, internet.Connection, dispatcher.Interface) error
}
// An Outbound process outbound connections.
type Outbound interface {
8 years ago
// Process processes the given connection. The given dialer may be used to dial a system outbound connection.
Process(context.Context, ray.OutboundRay, Dialer) error
}
// Dialer is used by OutboundHandler for creating outbound connections.
type Dialer interface {
8 years ago
// Dial dials a system connection to the given destination.
Dial(ctx context.Context, destination net.Destination) (internet.Connection, error)
}