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