<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Proxybonanza blog &#187; Programming</title>
	<atom:link href="http://blog.proxybonanza.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.proxybonanza.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 24 May 2010 19:48:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VB.NET proxy example</title>
		<link>http://blog.proxybonanza.com/programming/vb-net-proxy-example/</link>
		<comments>http://blog.proxybonanza.com/programming/vb-net-proxy-example/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 14:43:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[vb.net proxy]]></category>
		<category><![CDATA[visual basic proxy]]></category>

		<guid isPermaLink="false">http://blog.proxybonanza.com/?p=159</guid>
		<description><![CDATA[Useful vb.net code snippet using HTTP proxy from one of our readers.
Imports System.Collections.Generic
Imports System.IO
Imports System.Net

Namespace blogtest
Class Program
Private Shared Sub Main(args As String())
Dim http As New simplehttp()
‘testing on ipcheckit.com so we can make sure we’re really connecting through proxy. Look for proxy IP in html printed in console
‘remember to change 127.0.0.1, 8080, login, password to your [...]]]></description>
			<content:encoded><![CDATA[<p>Useful vb.net code snippet using HTTP proxy from one of our readers.
<pre class="brush:vbnet">Imports System.Collections.Generic
Imports System.IO
Imports System.Net

Namespace blogtest
Class Program
Private Shared Sub Main(args As String())
Dim http As New simplehttp()
‘testing on ipcheckit.com so we can make sure we’re really connecting through proxy. Look for proxy IP in html printed in console
‘remember to change 127.0.0.1, 8080, login, password to your working proxy details
Dim html As String = http.geturl(”http://ipcheckit.com/”, “127.0.0.1″, 8080, “login”, “password”)
System.Console.WriteLine(html)
End Sub
End Class

Class simplehttp
Public Function geturl(url As String, proxyip As String, port As Integer, proxylogin As String, proxypassword As String) As String
Dim resp As HttpWebResponse
Dim req As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
req.UserAgent = “Mozilla/5.0″
req.AllowAutoRedirect = True
req.ReadWriteTimeout = 5000
req.CookieContainer = New CookieContainer()
req.Referer = “”
req.Headers.[Set](”Accept-Language”, “en,en-us”)
Dim stream_in As StreamReader

Dim proxy As New WebProxy(proxyip, port)
‘if proxylogin is an empty string then don’t use proxy credentials (open proxy)
If proxylogin “” Then
proxy.Credentials = New NetworkCredential(proxylogin, proxypassword)
End If
req.Proxy = proxy

Dim response As String = “”
Try
resp = DirectCast(req.GetResponse(), HttpWebResponse)
stream_in = New StreamReader(resp.GetResponseStream())
response = stream_in.ReadToEnd()
stream_in.Close()
Catch ex As Exception
End Try
Return response
End Function

Public Function getposturl(url As String, postdata As String, proxyip As String, port As Short, proxylogin As String, proxypassword As String) As String
Dim resp As HttpWebResponse
Dim req As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
req.UserAgent = “Mozilla/5.0″
req.AllowAutoRedirect = True
req.ReadWriteTimeout = 5000
req.CookieContainer = New CookieContainer()
req.Method = “POST”
req.ContentType = “application/x-www-form-urlencoded”
req.ContentLength = postdata.Length
req.Referer = “”

Dim proxy As New WebProxy(proxyip, port)
‘if proxylogin is an empty string then don’t use proxy credentials (open proxy)
If proxylogin “” Then
proxy.Credentials = New NetworkCredential(proxylogin, proxypassword)
End If
req.Proxy = proxy

Dim stream_out As New StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII)
stream_out.Write(postdata)
stream_out.Close()
Dim response As String = “”

Try
resp = DirectCast(req.GetResponse(), HttpWebResponse)
Dim resStream As Stream = resp.GetResponseStream()
Dim stream_in As New StreamReader(req.GetResponse().GetResponseStream())
response = stream_in.ReadToEnd()
stream_in.Close()
Catch ex As Exception
End Try
Return response
End Function
End Class
End Namespace</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.proxybonanza.com/programming/vb-net-proxy-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple C# HTTP proxy class</title>
		<link>http://blog.proxybonanza.com/programming/simple-c-http-proxy-class/</link>
		<comments>http://blog.proxybonanza.com/programming/simple-c-http-proxy-class/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 10:23:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c sharp proxy]]></category>
		<category><![CDATA[c# proxy]]></category>

		<guid isPermaLink="false">http://blog.proxybonanza.com/?p=134</guid>
		<description><![CDATA[C# HTTP proxy example (GET and POST)]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re gonna create a simple C# class for doing HTTP requests using proxy. It will only have 2 methods: one for HTTP GET requests and other for POST requests. No error handling is done here so you&#8217;ll have to implement your own.  The code is self-explanatory.</p>
<pre class="brush:csharp">using System;
using System.Collections.Generic;
using System.IO;
using System.Net;

namespace blogtest
{
 class Program
 {
  static void Main(string[] args)
  {
   simplehttp http = new simplehttp();
   //testing on ipcheckit.com so we can make sure we're really connecting through proxy. Look for proxy IP in html printed in console
   //remember to change 127.0.0.1, 8080, login, password to your working proxy details
   string html = http.geturl("http://ipcheckit.com/", "127.0.0.1", 8080, "login", "password");
   System.Console.WriteLine(html);
  }
 }

class simplehttp
{
 public string geturl(string url, string proxyip, int port, string proxylogin, string proxypassword)
 {
  HttpWebResponse resp;
  HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  req.UserAgent = "Mozilla/5.0";
  req.AllowAutoRedirect = true;
  req.ReadWriteTimeout = 5000;
  req.CookieContainer = new CookieContainer();
  req.Referer = "";
  req.Headers.Set("Accept-Language", "en,en-us");
  StreamReader stream_in;

  WebProxy proxy = new WebProxy(proxyip, port);
  //if proxylogin is an empty string then don't use proxy credentials (open proxy)
  if (proxylogin != "") proxy.Credentials = new NetworkCredential(proxylogin, proxypassword);
  req.Proxy = proxy;

  string response = "";
  try
  {
   resp = (HttpWebResponse)req.GetResponse();
   stream_in = new StreamReader(resp.GetResponseStream());
   response = stream_in.ReadToEnd();
   stream_in.Close();
  }
  catch (Exception ex)
  {
  }
  return response;
 }

 public string getposturl(string url, string postdata, string proxyip, short port, string proxylogin, string proxypassword)
 {
  HttpWebResponse resp;
  HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  req.UserAgent = "Mozilla/5.0";
  req.AllowAutoRedirect = true;
  req.ReadWriteTimeout = 5000;
  req.CookieContainer = new CookieContainer();
  req.Method = "POST";
  req.ContentType = "application/x-www-form-urlencoded";
  req.ContentLength = postdata.Length;
  req.Referer = "";

  WebProxy proxy = new WebProxy(proxyip, port);
  //if proxylogin is an empty string then don't use proxy credentials (open proxy)
  if (proxylogin != "") proxy.Credentials = new NetworkCredential(proxylogin, proxypassword);
  req.Proxy = proxy;

  StreamWriter stream_out = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
  stream_out.Write(postdata);
  stream_out.Close();
  string response = "";

  try
  {
   resp = (HttpWebResponse)req.GetResponse();
   Stream resStream = resp.GetResponseStream();
   StreamReader stream_in = new StreamReader(req.GetResponse().GetResponseStream());
   response = stream_in.ReadToEnd();
   stream_in.Close();
  }
  catch (Exception ex)
  {
  }
  return response;
 }
 }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.proxybonanza.com/programming/simple-c-http-proxy-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP curl with proxy</title>
		<link>http://blog.proxybonanza.com/programming/php-curl-with-proxy/</link>
		<comments>http://blog.proxybonanza.com/programming/php-curl-with-proxy/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 10:33:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.proxybonanza.com/?p=54</guid>
		<description><![CDATA[PHP + CURL example using proxy]]></description>
			<content:encoded><![CDATA[<p>Here is a simple PHP code snippet requesting given URL using curl and HTTP proxy server.</p>
<pre class="brush:php">
$loginpassw = 'login:password';  //your proxy login and password here
$proxy_ip = '127.0.0.1'; //proxy IP here
$proxy_port = 8080; //proxy port from your proxy list
$url = 'http://yahoo.com'; //URL to get

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // output to variable
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);
$data = curl_exec($ch);
curl_close($ch);

echo $data;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.proxybonanza.com/programming/php-curl-with-proxy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
