source: code/trunk/vendor/golang.org/x/net/proxy/direct.go@ 145

Last change on this file since 145 was 145, checked in by Izuru Yakumo, 22 months ago

Updated the Makefile and vendored depedencies

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 832 bytes
Line 
1// Copyright 2011 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package proxy
6
7import (
8 "context"
9 "net"
10)
11
12type direct struct{}
13
14// Direct implements Dialer by making network connections directly using net.Dial or net.DialContext.
15var Direct = direct{}
16
17var (
18 _ Dialer = Direct
19 _ ContextDialer = Direct
20)
21
22// Dial directly invokes net.Dial with the supplied parameters.
23func (direct) Dial(network, addr string) (net.Conn, error) {
24 return net.Dial(network, addr)
25}
26
27// DialContext instantiates a net.Dialer and invokes its DialContext receiver with the supplied parameters.
28func (direct) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
29 var d net.Dialer
30 return d.DialContext(ctx, network, addr)
31}
Note: See TracBrowser for help on using the repository browser.