blob: 01983d916b67e018dc080e4a0c6905df1ba32624 [file] [log] [blame]
[email protected]9eb7b11b2012-03-28 20:19:311// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]3cd17242009-06-23 02:59:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/socket/socks_client_socket.h"
6
7#include "base/basictypes.h"
[email protected]aa22b242011-11-16 18:58:298#include "base/bind.h"
[email protected]3cd17242009-06-23 02:59:029#include "base/compiler_specific.h"
[email protected]9eb7b11b2012-03-28 20:19:3110#include "base/sys_byteorder.h"
[email protected]3cd17242009-06-23 02:59:0211#include "net/base/io_buffer.h"
[email protected]9e743cd2010-03-16 07:03:5312#include "net/base/net_log.h"
[email protected]3cd17242009-06-23 02:59:0213#include "net/base/net_util.h"
[email protected]a540c2d2009-12-12 00:47:3714#include "net/base/sys_addrinfo.h"
[email protected]a796bcec2010-03-22 17:17:2615#include "net/socket/client_socket_handle.h"
[email protected]3cd17242009-06-23 02:59:0216
17namespace net {
18
19// Every SOCKS server requests a user-id from the client. It is optional
20// and we send an empty string.
21static const char kEmptyUserId[] = "";
22
[email protected]3cd17242009-06-23 02:59:0223// For SOCKS4, the client sends 8 bytes plus the size of the user-id.
[email protected]76a51ac82009-06-28 07:58:5824static const unsigned int kWriteHeaderSize = 8;
[email protected]3cd17242009-06-23 02:59:0225
[email protected]034d3892011-03-29 04:07:2126// For SOCKS4 the server sends 8 bytes for acknowledgement.
[email protected]76a51ac82009-06-28 07:58:5827static const unsigned int kReadHeaderSize = 8;
[email protected]3cd17242009-06-23 02:59:0228
29// Server Response codes for SOCKS.
30static const uint8 kServerResponseOk = 0x5A;
31static const uint8 kServerResponseRejected = 0x5B;
32static const uint8 kServerResponseNotReachable = 0x5C;
33static const uint8 kServerResponseMismatchedUserId = 0x5D;
34
35static const uint8 kSOCKSVersion4 = 0x04;
36static const uint8 kSOCKSStreamRequest = 0x01;
37
[email protected]034d3892011-03-29 04:07:2138// A struct holding the essential details of the SOCKS4 Server Request.
[email protected]3cd17242009-06-23 02:59:0239// The port in the header is stored in network byte order.
40struct SOCKS4ServerRequest {
41 uint8 version;
42 uint8 command;
43 uint16 nw_port;
44 uint8 ip[4];
45};
46COMPILE_ASSERT(sizeof(SOCKS4ServerRequest) == kWriteHeaderSize,
47 socks4_server_request_struct_wrong_size);
48
[email protected]034d3892011-03-29 04:07:2149// A struct holding details of the SOCKS4 Server Response.
[email protected]3cd17242009-06-23 02:59:0250struct SOCKS4ServerResponse {
51 uint8 reserved_null;
52 uint8 code;
53 uint16 port;
54 uint8 ip[4];
55};
56COMPILE_ASSERT(sizeof(SOCKS4ServerResponse) == kReadHeaderSize,
57 socks4_server_response_struct_wrong_size);
58
[email protected]a796bcec2010-03-22 17:17:2659SOCKSClientSocket::SOCKSClientSocket(ClientSocketHandle* transport_socket,
[email protected]3cd17242009-06-23 02:59:0260 const HostResolver::RequestInfo& req_info,
61 HostResolver* host_resolver)
[email protected]83039bb2011-12-09 18:43:5562 : transport_(transport_socket),
[email protected]3cd17242009-06-23 02:59:0263 next_state_(STATE_NONE),
[email protected]3cd17242009-06-23 02:59:0264 completed_handshake_(false),
65 bytes_sent_(0),
66 bytes_received_(0),
[email protected]76a51ac82009-06-28 07:58:5867 host_resolver_(host_resolver),
[email protected]a2006ece2010-04-23 16:44:0268 host_request_info_(req_info),
69 net_log_(transport_socket->socket()->NetLog()) {
[email protected]3cd17242009-06-23 02:59:0270}
71
[email protected]3268023f2011-05-05 00:08:1072SOCKSClientSocket::SOCKSClientSocket(StreamSocket* transport_socket,
[email protected]a796bcec2010-03-22 17:17:2673 const HostResolver::RequestInfo& req_info,
74 HostResolver* host_resolver)
[email protected]83039bb2011-12-09 18:43:5575 : transport_(new ClientSocketHandle()),
[email protected]a796bcec2010-03-22 17:17:2676 next_state_(STATE_NONE),
[email protected]a796bcec2010-03-22 17:17:2677 completed_handshake_(false),
78 bytes_sent_(0),
79 bytes_received_(0),
80 host_resolver_(host_resolver),
[email protected]a2006ece2010-04-23 16:44:0281 host_request_info_(req_info),
82 net_log_(transport_socket->NetLog()) {
[email protected]a796bcec2010-03-22 17:17:2683 transport_->set_socket(transport_socket);
84}
85
[email protected]3cd17242009-06-23 02:59:0286SOCKSClientSocket::~SOCKSClientSocket() {
87 Disconnect();
88}
89
[email protected]83039bb2011-12-09 18:43:5590int SOCKSClientSocket::Connect(const CompletionCallback& callback) {
[email protected]3cd17242009-06-23 02:59:0291 DCHECK(transport_.get());
[email protected]a796bcec2010-03-22 17:17:2692 DCHECK(transport_->socket());
[email protected]3cd17242009-06-23 02:59:0293 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:5594 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:0295
96 // If already connected, then just return OK.
97 if (completed_handshake_)
98 return OK;
99
100 next_state_ = STATE_RESOLVE_HOST;
[email protected]5a05c47a2009-11-02 23:25:19101
[email protected]ec11be62010-04-28 19:28:09102 net_log_.BeginEvent(NetLog::TYPE_SOCKS_CONNECT, NULL);
[email protected]3cd17242009-06-23 02:59:02103
104 int rv = DoLoop(OK);
[email protected]5a05c47a2009-11-02 23:25:19105 if (rv == ERR_IO_PENDING) {
[email protected]83039bb2011-12-09 18:43:55106 user_callback_ = callback;
[email protected]5a05c47a2009-11-02 23:25:19107 } else {
[email protected]d7fd1782011-02-08 19:16:43108 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv);
[email protected]5a05c47a2009-11-02 23:25:19109 }
[email protected]3cd17242009-06-23 02:59:02110 return rv;
111}
112
113void SOCKSClientSocket::Disconnect() {
114 completed_handshake_ = false;
[email protected]16a02742010-01-07 22:50:10115 host_resolver_.Cancel();
[email protected]a796bcec2010-03-22 17:17:26116 transport_->socket()->Disconnect();
[email protected]16a02742010-01-07 22:50:10117
118 // Reset other states to make sure they aren't mistakenly used later.
119 // These are the states initialized by Connect().
120 next_state_ = STATE_NONE;
[email protected]dbf036f2011-12-06 23:33:24121 user_callback_.Reset();
[email protected]3cd17242009-06-23 02:59:02122}
123
124bool SOCKSClientSocket::IsConnected() const {
[email protected]a796bcec2010-03-22 17:17:26125 return completed_handshake_ && transport_->socket()->IsConnected();
[email protected]3cd17242009-06-23 02:59:02126}
127
128bool SOCKSClientSocket::IsConnectedAndIdle() const {
[email protected]a796bcec2010-03-22 17:17:26129 return completed_handshake_ && transport_->socket()->IsConnectedAndIdle();
[email protected]3cd17242009-06-23 02:59:02130}
131
[email protected]e4be2dd2010-12-14 00:44:39132const BoundNetLog& SOCKSClientSocket::NetLog() const {
133 return net_log_;
134}
135
[email protected]9b5614a2010-08-25 20:29:45136void SOCKSClientSocket::SetSubresourceSpeculation() {
137 if (transport_.get() && transport_->socket()) {
138 transport_->socket()->SetSubresourceSpeculation();
139 } else {
140 NOTREACHED();
141 }
142}
143
144void SOCKSClientSocket::SetOmniboxSpeculation() {
145 if (transport_.get() && transport_->socket()) {
146 transport_->socket()->SetOmniboxSpeculation();
147 } else {
148 NOTREACHED();
149 }
150}
151
[email protected]0f873e82010-09-02 16:09:01152bool SOCKSClientSocket::WasEverUsed() const {
153 if (transport_.get() && transport_->socket()) {
154 return transport_->socket()->WasEverUsed();
155 }
156 NOTREACHED();
157 return false;
158}
159
[email protected]7f7e92392010-10-26 18:29:29160bool SOCKSClientSocket::UsingTCPFastOpen() const {
161 if (transport_.get() && transport_->socket()) {
162 return transport_->socket()->UsingTCPFastOpen();
163 }
164 NOTREACHED();
165 return false;
166}
167
[email protected]5e6efa52011-06-27 17:26:41168int64 SOCKSClientSocket::NumBytesRead() const {
169 if (transport_.get() && transport_->socket()) {
170 return transport_->socket()->NumBytesRead();
171 }
172 NOTREACHED();
173 return -1;
174}
175
176base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const {
177 if (transport_.get() && transport_->socket()) {
178 return transport_->socket()->GetConnectTimeMicros();
179 }
180 NOTREACHED();
181 return base::TimeDelta::FromMicroseconds(-1);
182}
183
[email protected]33661e482012-04-03 16:16:26184NextProto SOCKSClientSocket::GetNegotiatedProtocol() const {
185 if (transport_.get() && transport_->socket()) {
186 return transport_->socket()->GetNegotiatedProtocol();
187 }
188 NOTREACHED();
189 return kProtoUnknown;
190}
191
[email protected]3cd17242009-06-23 02:59:02192// Read is called by the transport layer above to read. This can only be done
193// if the SOCKS handshake is complete.
194int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len,
[email protected]3f55aa12011-12-07 02:03:33195 const CompletionCallback& callback) {
196 DCHECK(completed_handshake_);
197 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:55198 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02199
[email protected]a796bcec2010-03-22 17:17:26200 return transport_->socket()->Read(buf, buf_len, callback);
[email protected]3cd17242009-06-23 02:59:02201}
202
203// Write is called by the transport layer. This can only be done if the
204// SOCKS handshake is complete.
205int SOCKSClientSocket::Write(IOBuffer* buf, int buf_len,
[email protected]83039bb2011-12-09 18:43:55206 const CompletionCallback& callback) {
[email protected]3cd17242009-06-23 02:59:02207 DCHECK(completed_handshake_);
208 DCHECK_EQ(STATE_NONE, next_state_);
[email protected]83039bb2011-12-09 18:43:55209 DCHECK(user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02210
[email protected]a796bcec2010-03-22 17:17:26211 return transport_->socket()->Write(buf, buf_len, callback);
[email protected]3cd17242009-06-23 02:59:02212}
213
[email protected]d3f66572009-09-09 22:38:04214bool SOCKSClientSocket::SetReceiveBufferSize(int32 size) {
[email protected]a796bcec2010-03-22 17:17:26215 return transport_->socket()->SetReceiveBufferSize(size);
[email protected]d3f66572009-09-09 22:38:04216}
217
218bool SOCKSClientSocket::SetSendBufferSize(int32 size) {
[email protected]a796bcec2010-03-22 17:17:26219 return transport_->socket()->SetSendBufferSize(size);
[email protected]d3f66572009-09-09 22:38:04220}
221
[email protected]3cd17242009-06-23 02:59:02222void SOCKSClientSocket::DoCallback(int result) {
223 DCHECK_NE(ERR_IO_PENDING, result);
[email protected]83039bb2011-12-09 18:43:55224 DCHECK(!user_callback_.is_null());
[email protected]3cd17242009-06-23 02:59:02225
226 // Since Run() may result in Read being called,
227 // clear user_callback_ up front.
[email protected]83039bb2011-12-09 18:43:55228 CompletionCallback c = user_callback_;
229 user_callback_.Reset();
230 DVLOG(1) << "Finished setting up SOCKS handshake";
231 c.Run(result);
[email protected]3cd17242009-06-23 02:59:02232}
233
234void SOCKSClientSocket::OnIOComplete(int result) {
235 DCHECK_NE(STATE_NONE, next_state_);
236 int rv = DoLoop(result);
[email protected]5a05c47a2009-11-02 23:25:19237 if (rv != ERR_IO_PENDING) {
[email protected]d7fd1782011-02-08 19:16:43238 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SOCKS_CONNECT, rv);
[email protected]3cd17242009-06-23 02:59:02239 DoCallback(rv);
[email protected]5a05c47a2009-11-02 23:25:19240 }
[email protected]3cd17242009-06-23 02:59:02241}
242
243int SOCKSClientSocket::DoLoop(int last_io_result) {
244 DCHECK_NE(next_state_, STATE_NONE);
245 int rv = last_io_result;
246 do {
247 State state = next_state_;
248 next_state_ = STATE_NONE;
249 switch (state) {
250 case STATE_RESOLVE_HOST:
251 DCHECK_EQ(OK, rv);
252 rv = DoResolveHost();
253 break;
254 case STATE_RESOLVE_HOST_COMPLETE:
255 rv = DoResolveHostComplete(rv);
256 break;
257 case STATE_HANDSHAKE_WRITE:
258 DCHECK_EQ(OK, rv);
259 rv = DoHandshakeWrite();
260 break;
261 case STATE_HANDSHAKE_WRITE_COMPLETE:
262 rv = DoHandshakeWriteComplete(rv);
263 break;
264 case STATE_HANDSHAKE_READ:
265 DCHECK_EQ(OK, rv);
266 rv = DoHandshakeRead();
267 break;
268 case STATE_HANDSHAKE_READ_COMPLETE:
269 rv = DoHandshakeReadComplete(rv);
270 break;
271 default:
272 NOTREACHED() << "bad state";
273 rv = ERR_UNEXPECTED;
274 break;
275 }
276 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
277 return rv;
278}
279
280int SOCKSClientSocket::DoResolveHost() {
[email protected]3cd17242009-06-23 02:59:02281 next_state_ = STATE_RESOLVE_HOST_COMPLETE;
[email protected]034d3892011-03-29 04:07:21282 // SOCKS4 only supports IPv4 addresses, so only try getting the IPv4
283 // addresses for the target host.
284 host_request_info_.set_address_family(ADDRESS_FAMILY_IPV4);
[email protected]ec08bb22009-08-12 00:25:12285 return host_resolver_.Resolve(
[email protected]aa22b242011-11-16 18:58:29286 host_request_info_, &addresses_,
287 base::Bind(&SOCKSClientSocket::OnIOComplete, base::Unretained(this)),
288 net_log_);
[email protected]3cd17242009-06-23 02:59:02289}
290
291int SOCKSClientSocket::DoResolveHostComplete(int result) {
[email protected]034d3892011-03-29 04:07:21292 if (result != OK) {
293 // Resolving the hostname failed; fail the request rather than automatically
294 // falling back to SOCKS4a (since it can be confusing to see invalid IP
295 // addresses being sent to the SOCKS4 server when it doesn't support 4A.)
296 return result;
[email protected]3cd17242009-06-23 02:59:02297 }
298
[email protected]034d3892011-03-29 04:07:21299 next_state_ = STATE_HANDSHAKE_WRITE;
[email protected]3cd17242009-06-23 02:59:02300 return OK;
301}
302
303// Builds the buffer that is to be sent to the server.
[email protected]76a51ac82009-06-28 07:58:58304const std::string SOCKSClientSocket::BuildHandshakeWriteBuffer() const {
[email protected]76a51ac82009-06-28 07:58:58305 SOCKS4ServerRequest request;
306 request.version = kSOCKSVersion4;
307 request.command = kSOCKSStreamRequest;
[email protected]9eb7b11b2012-03-28 20:19:31308 request.nw_port = base::HostToNet16(host_request_info_.port());
[email protected]3cd17242009-06-23 02:59:02309
[email protected]034d3892011-03-29 04:07:21310 const struct addrinfo* ai = addresses_.head();
311 DCHECK(ai);
[email protected]3cd17242009-06-23 02:59:02312
[email protected]034d3892011-03-29 04:07:21313 // We disabled IPv6 results when resolving the hostname, so none of the
314 // results in the list will be IPv6.
315 // TODO(eroman): we only ever use the first address in the list. It would be
316 // more robust to try all the IP addresses we have before
317 // failing the connect attempt.
318 CHECK_EQ(AF_INET, ai->ai_addr->sa_family);
319 struct sockaddr_in* ipv4_host =
320 reinterpret_cast<struct sockaddr_in*>(ai->ai_addr);
321 memcpy(&request.ip, &ipv4_host->sin_addr, sizeof(ipv4_host->sin_addr));
322
323 DVLOG(1) << "Resolved Host is : " << NetAddressToString(ai);
[email protected]3cd17242009-06-23 02:59:02324
[email protected]76a51ac82009-06-28 07:58:58325 std::string handshake_data(reinterpret_cast<char*>(&request),
326 sizeof(request));
327 handshake_data.append(kEmptyUserId, arraysize(kEmptyUserId));
[email protected]3cd17242009-06-23 02:59:02328
[email protected]76a51ac82009-06-28 07:58:58329 return handshake_data;
[email protected]3cd17242009-06-23 02:59:02330}
331
332// Writes the SOCKS handshake data to the underlying socket connection.
333int SOCKSClientSocket::DoHandshakeWrite() {
334 next_state_ = STATE_HANDSHAKE_WRITE_COMPLETE;
335
[email protected]76a51ac82009-06-28 07:58:58336 if (buffer_.empty()) {
337 buffer_ = BuildHandshakeWriteBuffer();
[email protected]3cd17242009-06-23 02:59:02338 bytes_sent_ = 0;
339 }
340
[email protected]76a51ac82009-06-28 07:58:58341 int handshake_buf_len = buffer_.size() - bytes_sent_;
342 DCHECK_GT(handshake_buf_len, 0);
343 handshake_buf_ = new IOBuffer(handshake_buf_len);
344 memcpy(handshake_buf_->data(), &buffer_[bytes_sent_],
345 handshake_buf_len);
[email protected]83039bb2011-12-09 18:43:55346 return transport_->socket()->Write(
347 handshake_buf_, handshake_buf_len,
348 base::Bind(&SOCKSClientSocket::OnIOComplete, base::Unretained(this)));
[email protected]3cd17242009-06-23 02:59:02349}
350
351int SOCKSClientSocket::DoHandshakeWriteComplete(int result) {
[email protected]3cd17242009-06-23 02:59:02352 if (result < 0)
353 return result;
354
[email protected]76a51ac82009-06-28 07:58:58355 // We ignore the case when result is 0, since the underlying Write
356 // may return spurious writes while waiting on the socket.
357
[email protected]3cd17242009-06-23 02:59:02358 bytes_sent_ += result;
[email protected]76a51ac82009-06-28 07:58:58359 if (bytes_sent_ == buffer_.size()) {
[email protected]3cd17242009-06-23 02:59:02360 next_state_ = STATE_HANDSHAKE_READ;
[email protected]76a51ac82009-06-28 07:58:58361 buffer_.clear();
362 } else if (bytes_sent_ < buffer_.size()) {
[email protected]3cd17242009-06-23 02:59:02363 next_state_ = STATE_HANDSHAKE_WRITE;
364 } else {
365 return ERR_UNEXPECTED;
366 }
367
368 return OK;
369}
370
371int SOCKSClientSocket::DoHandshakeRead() {
[email protected]3cd17242009-06-23 02:59:02372 next_state_ = STATE_HANDSHAKE_READ_COMPLETE;
373
[email protected]76a51ac82009-06-28 07:58:58374 if (buffer_.empty()) {
[email protected]3cd17242009-06-23 02:59:02375 bytes_received_ = 0;
376 }
377
[email protected]76a51ac82009-06-28 07:58:58378 int handshake_buf_len = kReadHeaderSize - bytes_received_;
379 handshake_buf_ = new IOBuffer(handshake_buf_len);
[email protected]a796bcec2010-03-22 17:17:26380 return transport_->socket()->Read(handshake_buf_, handshake_buf_len,
[email protected]83039bb2011-12-09 18:43:55381 base::Bind(&SOCKSClientSocket::OnIOComplete,
382 base::Unretained(this)));
[email protected]3cd17242009-06-23 02:59:02383}
384
385int SOCKSClientSocket::DoHandshakeReadComplete(int result) {
[email protected]3cd17242009-06-23 02:59:02386 if (result < 0)
387 return result;
[email protected]76a51ac82009-06-28 07:58:58388
389 // The underlying socket closed unexpectedly.
390 if (result == 0)
391 return ERR_CONNECTION_CLOSED;
392
[email protected]d5a309592010-02-05 02:22:52393 if (bytes_received_ + result > kReadHeaderSize) {
[email protected]9e743cd2010-03-16 07:03:53394 // TODO(eroman): Describe failure in NetLog.
[email protected]d5a309592010-02-05 02:22:52395 return ERR_SOCKS_CONNECTION_FAILED;
396 }
[email protected]3cd17242009-06-23 02:59:02397
[email protected]76a51ac82009-06-28 07:58:58398 buffer_.append(handshake_buf_->data(), result);
[email protected]3cd17242009-06-23 02:59:02399 bytes_received_ += result;
[email protected]76a51ac82009-06-28 07:58:58400 if (bytes_received_ < kReadHeaderSize) {
[email protected]3cd17242009-06-23 02:59:02401 next_state_ = STATE_HANDSHAKE_READ;
402 return OK;
403 }
404
[email protected]76a51ac82009-06-28 07:58:58405 const SOCKS4ServerResponse* response =
406 reinterpret_cast<const SOCKS4ServerResponse*>(buffer_.data());
[email protected]3cd17242009-06-23 02:59:02407
408 if (response->reserved_null != 0x00) {
409 LOG(ERROR) << "Unknown response from SOCKS server.";
[email protected]d5a309592010-02-05 02:22:52410 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02411 }
412
[email protected]3cd17242009-06-23 02:59:02413 switch (response->code) {
414 case kServerResponseOk:
415 completed_handshake_ = true;
416 return OK;
417 case kServerResponseRejected:
418 LOG(ERROR) << "SOCKS request rejected or failed";
[email protected]d5a309592010-02-05 02:22:52419 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02420 case kServerResponseNotReachable:
421 LOG(ERROR) << "SOCKS request failed because client is not running "
422 << "identd (or not reachable from the server)";
[email protected]d5a309592010-02-05 02:22:52423 return ERR_SOCKS_CONNECTION_HOST_UNREACHABLE;
[email protected]3cd17242009-06-23 02:59:02424 case kServerResponseMismatchedUserId:
425 LOG(ERROR) << "SOCKS request failed because client's identd could "
426 << "not confirm the user ID string in the request";
[email protected]d5a309592010-02-05 02:22:52427 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02428 default:
429 LOG(ERROR) << "SOCKS server sent unknown response";
[email protected]d5a309592010-02-05 02:22:52430 return ERR_SOCKS_CONNECTION_FAILED;
[email protected]3cd17242009-06-23 02:59:02431 }
432
433 // Note: we ignore the last 6 bytes as specified by the SOCKS protocol
434}
435
[email protected]ac9eec62010-02-20 18:50:38436int SOCKSClientSocket::GetPeerAddress(AddressList* address) const {
[email protected]a796bcec2010-03-22 17:17:26437 return transport_->socket()->GetPeerAddress(address);
[email protected]3cd17242009-06-23 02:59:02438}
[email protected]3cd17242009-06-23 02:59:02439
[email protected]e7f74da2011-04-19 23:49:35440int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const {
441 return transport_->socket()->GetLocalAddress(address);
442}
443
[email protected]3cd17242009-06-23 02:59:02444} // namespace net