Mat Whiteside
Mat Whiteside

Reputation: 561

Connection to MySQL through proxy server

So I'm developing an application for my school in C#. I need to know how to connect via a proxy server to the MySQL database. I've been having a look around and found the following code:

NetworkCredential credential=new NetworkCredential("User","Password");
WebProxy proxy=new WebProxy("10.0.0.1",808);
proxy.Credentials=credential;

MySqlConnection conn = new MySqlConnection();
conn.ConnectionString = "Host=192.168.0.10;port=3307;user=root;password=root";
conn.Proxy=proxy;

However, the line conn.Proxy=proxy; doesn't work as conn doesn't contain a definition for Proxy.

So how do I connectt to MySQL through a proxy in C#?

Upvotes: 1

Views: 2573

Answers (1)

Mat Whiteside
Mat Whiteside

Reputation: 561

For anyone else having the problem, this is how I got around it:

http://www.hanselman.com/blog/HTTPPOSTsAndHTTPGETsWithWebClientAndCAndFakingAPostBack.aspx

Upvotes: 1

Related Questions