1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-04-22 02:42:49 -04:00
v2fly/proxy/proxy.go

28 lines
723 B
Go
Raw Normal View History

// Package proxy contains all proxies used by V2Ray.
2016-08-19 17:05:15 +02:00
package proxy
import (
2017-01-15 00:17:06 +01:00
"context"
2017-01-14 00:27:45 +01:00
"v2ray.com/core/common/net"
2016-08-20 20:55:45 +02:00
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/ray"
)
2016-01-25 21:33:28 +01:00
// An InboundHandler handles inbound network connections to V2Ray.
type InboundHandler interface {
2017-01-15 00:57:06 +01:00
Network() net.NetworkList
Process(context.Context, net.Network, internet.Connection) error
}
2016-01-25 21:33:28 +01:00
// An OutboundHandler handles outbound network connection for V2Ray.
type OutboundHandler interface {
Process(context.Context, ray.OutboundRay) error
}
2017-01-15 00:17:06 +01:00
// Dialer is used by OutboundHandler for creating outbound connections.
type Dialer interface {
Dial(ctx context.Context, destination net.Destination) (internet.Connection, error)
}