Does anyone know a Http proxy source code written in C#? I want a proxy to write a proxy that will filter the response and forward it to the client! I have been referring to the Mentalis project and it seems like their proxy doesn't work in multi-threaded environment!
Anyone knows a multi-threaded http proxy server open source project ?
FiddlerCore is what I use.
You can probably make what you need by forking this
https://github.com/mcintyre321/WebAPI-Proxy
http/https reverse proxy with full source - assembly code that can be linked to any exe. comes with sample forms and service projects
https://github.com/CalypsoSys/Babalu_rProxy
https://github.com/justcoding121/Titanium-Web-Proxy
This one is complete source code with SSL proxy.
Related
I am using C# with Visual Studio. I have imported a WSDL file into my project, so that VS automatically created a class for me to use the appropriate services.
Now I got an error from the server and for debugging purposes I would like to see the RAW response of the server. It looks that this is quite complicated to obtain.
Please take a look at the screenshot below:
I've got only the "base.channel" object. But also after a long time of digging into all the attributes and sub-objects, I'm still not able to find the actual servers response.
The code on line 6776 is the first and only one where I can stop. So there is no possibility to look into some objects earlier.
I'm quite new to Server Client based applications with C# and WSDL. I really hope, that the mechanism, how the requests work, are always the same, so that someone could give me a hint how I can retrieve the servers raw response.
Since it is HTTPS, wireshark is no option.
Thanks
Found the solution:
I used Fiddler which is able to decrypt also SSL traffic!
According to my research whilst trying to solve this problem, it turns out that the .Net WebProxy class does not support Socks proxies - a tad annoying. I also can't seem to find any code or information which explains how to implement Socks 4/5 support via a class which can easily be used with HttpWebRequest (the Proxy property, to be exact).
I've found limited information via google on how I could do this. One suggestion involves changing internet explorer proxy settings - something I'd rather not do.
Does anyone know of anything which could do the job or have any suggestions? Any help would be much appreciated.
I tried numerous .Net libraries which claimed to support Socks4/5 but found many of them just did not work or would error trying to connect to proxies I knew were functioning.
I've ended up using Chilkat Software's Sock/SSL component which seems to work well for me even if I do have to manually construct the HTTP requests instead of using HttpWebRequest as I would have liked.
Update note: Chilkat.Http (similar to the HttpWebRequest class) does inherently have support for SOCKS proxies. So don't spend time trying to code your own HTTP requests as I did; just use the Chilkat.Http.SocksHostname, Chilkat.Http.SocksPort and Chilkat.Http.SocksVersion properties.
Changing IE's proxy settings won't help you at all-- the other poster was just observing that it works for IE. Because the .NET Framework doesn't support SOCKS, you'd have to write your own CERN-Proxy to SOCKS-Proxy converter, such that .NET talks to the CERN proxy (the type it supports) and your code converts that to a SOCKS proxy call.
FWIW, this is something I'm presently looking to add to FiddlerCore (www.fiddler2.com/core) because I already have almost all of the code. The only thing I really need is a SOCKSv4a proxy to test against.
Since .NET 6, socks proxies can be used natively with HttpClient. See this issue on GitHub.
Use Privoxy or same to create http proxy gateway to your socks.
Add this to main config to chain Privoxy and socks:
forward-socks5 / proxy_host:port .
And something like that to enable direct access to your local network:
forward 192.168.*.*/ .
forward 10.*.*.*/ .
forward 127.*.*.*/ .
I've some strange problems with a web service. One problem is that I don't fully understand how SOAP works.
It seems that it is possible that two different application can connect to e.g. 127.0.0.1:8000 at least that seems possible with the code that is generated with the .NET WSDL tool. But IMO only one application is allowed to bind to a port and listen to HTTP responses. Do the .NET classes do something silently?
For a tiny test I tried to do everything on my own with the HttpWebRequest class to see where the problem is. I get some 500 StatusMessages from the Webserver that the EndpointDistpacher is unable to find an AddressFilter (I think it's probably an .NET exception for the server transfered over HTTP). I copied the SOAP request from another client that works. What I here do not understand. Does the server probably open another new connection to the client, instead of answer to the already open connection?
I don't seek direct answers for my problems. What I really wonder how TCP/HTTP is used in the background for raw SOAP and for WS-Adressing. And what I've to do, to create a simple stupid client, assuming that I only have a TCP/HTTP class.
I have a server client application.
The clients sends the server http posts with info every second or so.
The server is implemented using C#, there server doesn't need to respond in any way to the client.
Whats the easiest and most practical way to get this done? Is there some kind of library that is easy to use that I can import into my project.
Why not just use a regular old web service? It sounds like you have simple functionality that doesn't need to maintain a connection state. With a web service, you can simply expose the methods to your client, accessible via HTTP/S. If you're already using .NET for your client, you can simply add a web reference to your project and have .NET do the heavy lifting for you. There wouldn't be any need to reinvent the wheel.
You can use http.sys to create your own http listener without IIS or additional overhead. Aaron Skonnard has a good article here.
Because of certain limitations of uhttpsharp (specifically no support for POST forms and file uploads and it using threads to process requests), I've made NHttp available at github which supports full request parsing like ASP.net and processes requests using the asynchronous TCP model.
I have written a simple HTTP Proxy server in C# that I would like to integration/functional test. Is there a product already created that I could use to do this? If not, what is the best way to write my own tests for this (I already have unit tests)?
To test the integration by delivering a webpage you could try one of the following:
Selenium
WaTiN
Watir
You can run Watin tests directly from xUnit in C# too - we do this for our applications. I also believe it is possible to dynamically set the proxy settings in the browser for Watin (and probably the others too).
Alternatively to make HTTP requests to a given address try JMeter.
Slightly offtopic: Having seen a share of custom HTTP proxies, the usual feature their authors forget (and later discover that they need) is the support for the CONNECT method. Without CONNECT your proxy can't be used for TLS/SSL connections. Also, software that tunnels their non-HTTP traffic via the proxy won't work either.
There are two more products to use:
Web Polygraph
Funkload
Both are easy to find via Google. Both perform functional and load testing of web servers/proxies.
When you're using the above, I'd also suggest running one of the latency/packet loss injection tools discussed in Best way to simulate a WAN network. It's regrettably easy to decide that your proxy is stable when you test it in a non-messy environment.