|
|
@@ -38,7 +38,7 @@ 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 {
|
|
|
+func (c *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
|
|
|
destination, ok := proxy.TargetFromContext(ctx)
|
|
|
if !ok {
|
|
|
return newError("target not specified")
|
|
|
@@ -49,7 +49,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale
|
|
|
var conn internet.Connection
|
|
|
|
|
|
err := retry.ExponentialBackoff(5, 100).On(func() error {
|
|
|
- server = v.serverPicker.PickServer()
|
|
|
+ server = c.serverPicker.PickServer()
|
|
|
dest := server.Destination()
|
|
|
dest.Network = network
|
|
|
rawConn, err := dialer.Dial(ctx, dest)
|
|
|
@@ -90,7 +90,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale
|
|
|
request.Option |= RequestOptionOneTimeAuth
|
|
|
}
|
|
|
|
|
|
- sessionPolicy := v.v.PolicyManager().ForLevel(user.Level)
|
|
|
+ sessionPolicy := c.v.PolicyManager().ForLevel(user.Level)
|
|
|
ctx, cancel := context.WithCancel(ctx)
|
|
|
timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle)
|
|
|
|