<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=559033</guid>
        <pubDate>Tue, 28 Dec 2004 15:44:54 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=559033</link>
        <description><![CDATA[Gazon: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=77654&view=findpost&p=558988'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>kosten_spb &#064; 28.12.04, 18:13</span><div class='quote '>В описаном мною примере НТТР запрос отправляется прокси серверу, который перенаправляет его на необходимый узел. В моем случае это www.host.com. Я ведь указал что это пример для работы с веб-сервером.</div></div><br>
Спасибо. ;) <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2004-12-28T18:48:33+03:00">28.12.04, 15:48</time></span></span><br>
кстати, если кому интересно, то на codeproject.com нарыл класс, который реализует оболчку над Socket работающий по протоколу SOCKS5.<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">using System;</div><div class="code_line">using System.Net;</div><div class="code_line">using System.Net.Sockets;</div><div class="code_line">using System.Text;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">/*</div><div class="code_line">* zahmed</div><div class="code_line">* Date 23 Jan 2004</div><div class="code_line">* Socks 5 RFC is available at http://www.faqs.org/rfcs/rfc1928.html.</div><div class="code_line">*/</div><div class="code_line">namespace LMKR</div><div class="code_line">{</div><div class="code_line">public class ConnectionException:ApplicationException</div><div class="code_line">{</div><div class="code_line">public ConnectionException(string message)</div><div class="code_line">&nbsp;&nbsp; &nbsp;:base(message)</div><div class="code_line">{</div><div class="code_line">}</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">/// &#60;summary&#62;</div><div class="code_line">/// Provides sock5 functionality to clients (Connect only).</div><div class="code_line">/// &#60;/summary&#62;</div><div class="code_line">public class SocksProxy</div><div class="code_line">{</div><div class="code_line">&nbsp;</div><div class="code_line">private SocksProxy(){} </div><div class="code_line">&nbsp;</div><div class="code_line">#region ErrorMessages</div><div class="code_line">private static string[] errorMsgs= &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Operation completed successfully.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;General SOCKS server failure.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Connection not allowed by ruleset.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Network unreachable.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Host unreachable.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Connection refused.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;TTL expired.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Command not supported.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Address type not supported.&quot;,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Unknown error.&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};</div><div class="code_line">#endregion</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">public static Socket ConnectToSocks5Proxy(string proxyAdress, ushort proxyPort, string destAddress, ushort destPort,</div><div class="code_line">&nbsp;&nbsp; &nbsp;string userName, string password)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;IPAddress destIP = null;</div><div class="code_line">&nbsp;&nbsp; &nbsp;IPAddress proxyIP = null;</div><div class="code_line">&nbsp;&nbsp; &nbsp;byte[] request = new byte[257];</div><div class="code_line">&nbsp;&nbsp; &nbsp;byte[] response = new byte[257];</div><div class="code_line">&nbsp;&nbsp; &nbsp;ushort nIndex;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;proxyIP = &nbsp;IPAddress.Parse(proxyAdress);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;catch(FormatException)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ &nbsp; // get the IP address</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;proxyIP = Dns.GetHostByAddress(proxyAdress).AddressList[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// Parse destAddress (assume it in string dotted format &quot;212.116.65.112&quot; )</div><div class="code_line">&nbsp;&nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;destIP = IPAddress.Parse(destAddress);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;catch(FormatException)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// wrong assumption its in domain name format &quot;www.microsoft.com&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;IPEndPoint proxyEndPoint = new IPEndPoint(proxyIP,proxyPort);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// open a TCP connection to SOCKS server...</div><div class="code_line">&nbsp;&nbsp; &nbsp;Socket s = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);</div><div class="code_line">&nbsp;&nbsp; &nbsp;s.Connect(proxyEndPoint); &nbsp; </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;nIndex = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x05; // Version 5.</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x02; // 2 Authentication methods are in packet...</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x00; // NO AUTHENTICATION REQUIRED</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x02; // USERNAME/PASSWORD</div><div class="code_line">&nbsp;&nbsp; &nbsp;// Send the authentication negotiation request...</div><div class="code_line">&nbsp;&nbsp; &nbsp;s.Send(request,nIndex,SocketFlags.None);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// Receive 2 byte response...</div><div class="code_line">&nbsp;&nbsp; &nbsp;int nGot = s.Receive(response,2,SocketFlags.None); &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (nGot!=2)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;throw new ConnectionException(&quot;Bad response received from proxy server.&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (response[1]==0xFF)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ &nbsp; // No authentication method was accepted close the socket.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;s.Close();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;throw new ConnectionException(&quot;None of the authentication method was accepted by proxy server.&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;byte[] rawBytes;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (/*response[1]==0x02*/true)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{//Username/Password Authentication protocol</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;nIndex = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=0x05; // Version 5.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// add user name</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=(byte)userName.Length;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes = Encoding.Default.GetBytes(userName);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes.CopyTo(request,nIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;nIndex+=(ushort)rawBytes.Length;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// add password</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=(byte)password.Length;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes = Encoding.Default.GetBytes(password);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes.CopyTo(request,nIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;nIndex+=(ushort)rawBytes.Length;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// Send the Username/Password request</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;s.Send(request,nIndex,SocketFlags.None);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// Receive 2 byte response...</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;nGot = s.Receive(response,2,SocketFlags.None); &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (nGot!=2)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new ConnectionException(&quot;Bad response received from proxy server.&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (response[1] != 0x00)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new ConnectionException(&quot;Bad Usernaem/Password.&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;// This version only supports connect command. </div><div class="code_line">&nbsp;&nbsp; &nbsp;// UDP and Bind are not supported.</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// Send connect request now...</div><div class="code_line">&nbsp;&nbsp; &nbsp;nIndex = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x05; // version 5.</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x01; // command = connect.</div><div class="code_line">&nbsp;&nbsp; &nbsp;request[nIndex++]=0x00; // Reserve = must be 0x00</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (destIP != null)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{// Destination adress in an IP.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;switch(destIP.AddressFamily)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case AddressFamily.InterNetwork:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Address is IPV4 format</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=0x01;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rawBytes = destIP.GetAddressBytes();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rawBytes.CopyTo(request,nIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nIndex+=(ushort)rawBytes.Length;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case AddressFamily.InterNetworkV6:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Address is IPV6 format</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=0x04;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rawBytes = destIP.GetAddressBytes();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rawBytes.CopyTo(request,nIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nIndex+=(ushort)rawBytes.Length;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;{// Dest. address is domain name.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=0x03; // Address is full-qualified domain name.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=Convert.ToByte(destAddress.Length); // length of address.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes = Encoding.Default.GetBytes(destAddress);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;rawBytes.CopyTo(request,nIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;nIndex+=(ushort)rawBytes.Length;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// using big-edian byte order</div><div class="code_line">&nbsp;&nbsp; &nbsp;byte[] portBytes = BitConverter.GetBytes(destPort);</div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int i=portBytes.Length-1;i&#62;=0;i--)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;request[nIndex++]=portBytes[i];</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// send connect request.</div><div class="code_line">&nbsp;&nbsp; &nbsp;s.Send(request,nIndex,SocketFlags.None);</div><div class="code_line">&nbsp;&nbsp; &nbsp;s.Receive(response); &nbsp; &nbsp;// Get variable length response...</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (response[1]!=0x00)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;throw new ConnectionException(errorMsgs[response[1]]);</div><div class="code_line">&nbsp;&nbsp; &nbsp;// Success Connected...</div><div class="code_line">&nbsp;&nbsp; &nbsp;return s;</div><div class="code_line">}</div><div class="code_line">}</div><div class="code_line">}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Gazon</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558988</guid>
        <pubDate>Tue, 28 Dec 2004 15:13:53 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558988</link>
        <description><![CDATA[kosten_spb: В описаном мною примере НТТР запрос отправляется прокси серверу, который перенаправляет его на необходимый узел. В моем случае это www.host.com. Я ведь указал что это пример для работы с веб-сервером.]]></description>
        <author>kosten_spb</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558947</guid>
        <pubDate>Tue, 28 Dec 2004 14:21:58 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558947</link>
        <description><![CDATA[Gazon: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>Host: www.host.com</div></div><br>
А что за хост? При работе с сокетами, вроде нигде этого не указывается.]]></description>
        <author>Gazon</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558921</guid>
        <pubDate>Tue, 28 Dec 2004 14:04:48 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558921</link>
        <description><![CDATA[kosten_spb: Я делал на VC++ 6.0 приложение которое было основано на сокетах и работало в сети с прокси сервером. Маленькое &quot;но&quot; - мое приложение работало только с вэб, т.е. соединения шли на 80 порт.<br>Реализовано все было следующим образом:<br>1. Создать сокет, IP адрес получателя - адрес прокси-сервера, порт получателя - порт прокси - сервера<br>2. Сформировать НТТР запрос к ресурсу, на пример<br>    GET /some_page.html HTTP/1.1<br>    Host: www.host.com<br>3. Выполнить Send<br><br>Этот пример использует прокси-сервер без аутентификации. Для аутентификации на сервере НТТР запрос должен быть несколько изменен.<br>Если найду, выложу исходник своего приложения.]]></description>
        <author>kosten_spb</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558303</guid>
        <pubDate>Tue, 28 Dec 2004 06:58:17 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558303</link>
        <description><![CDATA[Guest: Скрести их :)]]></description>
        <author>Guest</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558272</guid>
        <pubDate>Tue, 28 Dec 2004 06:24:18 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=558272</link>
        <description><![CDATA[Guest: Делай наследника этих классов]]></description>
        <author>Guest</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557856</guid>
        <pubDate>Mon, 27 Dec 2004 18:10:46 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557856</link>
        <description><![CDATA[Gazon: но я сецчас говорю о классе socket, и как используя класс cocket указать, что мы хотим использовать прокси.]]></description>
        <author>Gazon</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557802</guid>
        <pubDate>Mon, 27 Dec 2004 17:37:55 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557802</link>
        <description><![CDATA[Guest: Пиши в Microsoft .NET Framework SDK слово Proxy<br>и у тебя так столько классов для работы с прокси и его созданию выпадет.]]></description>
        <author>Guest</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557726</guid>
        <pubDate>Mon, 27 Dec 2004 16:24:50 +0000</pubDate>
        <title>сокеты и прокси</title>
        <link>https://forum.sources.ru/index.php?showtopic=77654&amp;view=findpost&amp;p=557726</link>
        <description><![CDATA[Gazon: Вот пишу я клиента TCP<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Socket TempSocket = new Socket(AddressFamily.InterNetwork,</div><div class="code_line">SocketType.Stream, ProtocolType.Tcp);</div><div class="code_line">IPEndPoint ipep = new IPEndPoint(</div><div class="code_line">IPAddress.Parse(AdressOfServer), 9050);</div><div class="code_line">TempSocket.BeginConnect(ipep, new AsyncCallback(Connected), TempSocket);</div></ol></div></div></div></div><br>
<br>
А что если программа запустится и попытается подконнектиться на компьютере, который имеет выход в интернет через прокси? Мы ведь нигде этого не указываем в подключении в коде. Например браузеру, чтобы он смог коннектиться в интернет указывается в настройках прокси(если комп выходит в инет через прокси), а иначе он не сможет установить соединение. Моя программа я так понимаю тоже не сможет подконнектиться, тогда как с использованием сокетов указать, что выход будет через прокси?]]></description>
        <author>Gazon</author>
        <category>.NET: Распределенные приложения</category>
      </item>
	
      </channel>
      </rss>
	