1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 12:35:21 -05:00

update context functions

This commit is contained in:
Darien Raymond
2017-02-09 22:49:38 +01:00
parent d270a99d4f
commit d04d92c187
15 changed files with 122 additions and 98 deletions

View File

@@ -2,10 +2,9 @@ package shadowsocks
import (
"context"
"time"
"errors"
"runtime"
"time"
"v2ray.com/core/app/log"
"v2ray.com/core/common"
@@ -40,7 +39,10 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
// Process implements OutboundHandler.Process().
func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
destination := proxy.DestinationFromContext(ctx)
destination, ok := proxy.TargetFromContext(ctx)
if !ok {
return errors.New("Shadowsocks|Client: Target not specified.")
}
network := destination.Network
var server *protocol.ServerSpec