2

I want to know if it is possible to use a proxy to connect twitter with LinqToTwitter (c#) library. The objetive is to hide the ip source.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42

1 Answers1

3

I just browsed through the LinqToTwitter library source code here and even though I didn't find a way to specify a Proxy, the library uses HttpWebRequest internally, which will use a Proxy if you specify it in the App.config file as so:

<system.net>
  <defaultProxy enabled="true">
   <proxy bypassonlocal="true"
          proxyaddress="http://proxy.domain.org:8888/" />
  </defaultProxy>
 </system.net>

MSDN has this regarding the Proxy property in HttpWebRequest:

The Proxy property identifies the WebProxy object to use to process requests to Internet resources. To specify that no proxy should be used, set the Proxy property to the proxy instance returned by the GlobalProxySelection.GetEmptyWebProxy method. The local computer or application config file may specify that a default proxy be used. If the Proxy property is specified, then the proxy settings from the Proxy property override the local computer or application config file and the HttpWebRequest instance will use the proxy settings specified. If no proxy is specified in a config file and the Proxy property is unspecified, the HttpWebRequest class uses the proxy settings inherited from Internet Explorer on the local computer. If there are no proxy settings in Internet Explorer, the request is sent directly to the server. The HttpWebRequest class parses a proxy bypass list with wildcard characters inherited from Internet Explorer the same as the bypass list is parsed directly by Internet Explorer. For example, the HttpWebRequest class will parse a bypass list of "nt*" from Internet Explorer as a regular expression of "nt.*". So a URL of "http://nt.com" would bypass the proxy using the HttpWebRequest class and using Internet Explorer.

Icarus
  • 63,293
  • 14
  • 100
  • 115