2015-10-29 23:11:29 +00:00
|
|
|
package connhandler
|
2015-10-14 12:51:19 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/v2ray/v2ray-core/app"
|
2015-12-02 20:44:01 +00:00
|
|
|
v2net "github.com/v2ray/v2ray-core/common/net"
|
2015-10-14 12:51:19 +00:00
|
|
|
)
|
|
|
|
|
2015-10-15 11:15:59 +00:00
|
|
|
// A InboundConnectionHandlerFactory creates InboundConnectionHandler on demand.
|
2015-10-14 12:51:19 +00:00
|
|
|
type InboundConnectionHandlerFactory interface {
|
2015-10-15 11:15:59 +00:00
|
|
|
// Create creates a new InboundConnectionHandler with given configuration.
|
2015-12-05 21:55:45 +00:00
|
|
|
Create(space *app.Space, config interface{}) (InboundConnectionHandler, error)
|
2015-10-14 12:51:19 +00:00
|
|
|
}
|
|
|
|
|
2015-10-15 11:15:59 +00:00
|
|
|
// A InboundConnectionHandler handles inbound network connections to V2Ray.
|
2015-10-14 12:51:19 +00:00
|
|
|
type InboundConnectionHandler interface {
|
2015-10-15 11:15:59 +00:00
|
|
|
// Listen starts a InboundConnectionHandler by listen on a specific port. This method is called
|
|
|
|
// exactly once during runtime.
|
2015-12-02 20:44:01 +00:00
|
|
|
Listen(port v2net.Port) error
|
2015-10-14 12:51:19 +00:00
|
|
|
}
|