1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 09:15:37 -05:00

naming refactoring

This commit is contained in:
Darien Raymond
2017-02-13 13:16:37 +01:00
parent 4f27a07c29
commit 7b707275df
3 changed files with 19 additions and 17 deletions

View File

@@ -22,13 +22,13 @@ import (
"v2ray.com/core/transport/ray"
)
// VMessOutboundHandler is an outbound connection handler for VMess protocol.
type VMessOutboundHandler struct {
// Handler is an outbound connection handler for VMess protocol.
type Handler struct {
serverList *protocol.ServerList
serverPicker protocol.ServerPicker
}
func New(ctx context.Context, config *Config) (*VMessOutboundHandler, error) {
func New(ctx context.Context, config *Config) (*Handler, error) {
space := app.SpaceFromContext(ctx)
if space == nil {
return nil, errors.New("VMess|Outbound: No space in context.")
@@ -38,7 +38,7 @@ func New(ctx context.Context, config *Config) (*VMessOutboundHandler, error) {
for _, rec := range config.Receiver {
serverList.AddServer(protocol.NewServerSpecFromPB(*rec))
}
handler := &VMessOutboundHandler{
handler := &Handler{
serverList: serverList,
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
}
@@ -46,8 +46,8 @@ func New(ctx context.Context, config *Config) (*VMessOutboundHandler, error) {
return handler, nil
}
// Dispatch implements OutboundHandler.Dispatch().
func (v *VMessOutboundHandler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
// Process implements proxy.Outbound.Process().
func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
var rec *protocol.ServerSpec
var conn internet.Connection