v2ray-core/proxy/common/connhandler/outbound_connection.go

20 lines
695 B
Go
Raw Normal View History

package connhandler
2015-10-14 12:51:19 +00:00
import (
2015-12-06 10:00:10 +00:00
"github.com/v2ray/v2ray-core/app"
2015-10-14 12:51:19 +00:00
v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/transport/ray"
)
2015-10-15 11:15:59 +00:00
// An OutboundConnectionHandlerFactory creates OutboundConnectionHandler on demand.
2015-10-14 12:51:19 +00:00
type OutboundConnectionHandlerFactory interface {
2015-10-15 11:15:59 +00:00
// Create creates a new OutboundConnectionHandler with given config.
2015-12-06 10:00:10 +00:00
Create(space *app.Space, config interface{}) (OutboundConnectionHandler, error)
2015-10-14 12:51:19 +00:00
}
2015-10-15 11:15:59 +00:00
// An OutboundConnectionHandler handles outbound network connection for V2Ray.
2015-10-14 12:51:19 +00:00
type OutboundConnectionHandler interface {
2015-10-15 11:15:59 +00:00
// Dispatch sends one or more Packets to its destination.
2015-10-14 12:51:19 +00:00
Dispatch(firstPacket v2net.Packet, ray ray.OutboundRay) error
}