Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6539221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:49:55+00:00 2026-05-25T10:49:55+00:00

I am trying to develop a socks tunneling application in c# that is able

  • 0

I am trying to develop a socks tunneling application in c# that is able to open a website by using add and modified header requests (something similar to Modify Header Firefox Addon) and tunnel the data through a proxy (socks preferable). Please can anyone specify any resources I might need for this? Or any alternative that can perform the same function, open source that I can build on maybe, etc. Thanks!

ps: the applications should also be able to open https and other common network protocols

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:49:56+00:00Added an answer on May 25, 2026 at 10:49 am

    One way is to use HttpSys and create a local proxy server to handle request on the loopback 127.0.0.1 address. You would be change the system proxy to this address/port and sit between client and server.

    This would allow you to modify request/response packets & headers. There’s an example here of this approach in C#, and I’ve amended this below to show how it would work.

    public class MyProxy
    {
        private readonly HttpListener listener;
    
        public MyProxy()
        {
            listener = new HttpListener();
        }
    
        public void Start()
        {
            listener.Prefixes.Add("http://*:8888/");
            listener.Prefixes.Add("https://*:8889/");
            listener.Start();
            Console.WriteLine("Proxy started, hit enter to stop");
            listener.BeginGetContext(GetContextCallback, null);
            Console.ReadLine();
            listener.Stop();
        }
    
        public void GetContextCallback(IAsyncResult result)
        {
            var context = listener.EndGetContext(result);
            listener.BeginGetContext(GetContextCallback, null);
    
            var request = context.Request;
            var response = context.Response;
            var url = request.Url;
    
            UriBuilder builder = new UriBuilder(url);
            builder.Port = url.Port == 8888 ? 80 : 443;
            url = builder.Uri;
    
            WebRequest webRequest = WebRequest.Create(url);
    
            webRequest.Proxy = GlobalProxySelection.GetEmptyWebProxy();
            WebResponse webResponse = webRequest.GetResponse();
            using (Stream reader = webResponse.GetResponseStream())
            {
                using (Stream writer = response.OutputStream)
                {
                    reader.CopyTo(writer);
                }
            }
        }
    }
    

    The downside to this approach is it’s quite low level, and affects all traffic on the user machine which may not be desirable. You would have to handle SSL requests, and it would also impact any existing configured proxies.

    Another alternative approach is to use the Microsoft Internet Controls COM component and to extend the WebBrowser class. There’s a SO question here that shows the approach. Unfortunately the version of WebBrowser in the .NET namespace does not implement the request response objects. The interesting bits are below.

    public class ExtendedWebBrowser : WebBrowser
    {
        ...
    
        void BeforeNavigate(object pDisp, ref object url, ref object flags,
                           ref object targetFrameName, ref object postData, 
                           ref object headers, ref bool cancel)
        {
             if (!headers.Contains("X-RequestFlag")
             {
                 headers += "X-RequestFlag: true\r\n";
    
                 // append custom header here
    
                 // cancel current request
                 cancel = true;
    
                 // re-request with amended details
                 Navigate((string)url, (string)targetFrameName, (byte[])postData, 
                          (string)headers);
             }
             else
             {
                 base.BeforeNavigate(...);
             }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to develop an application that should show a map using the Google
I'm trying to develop an application that will use getImageData in javascript in Firefox
I'm trying to develop a firefox extension that inserts additional HTTP header fields into
I am trying to develop a sample application that finds the process name of
I am trying to develop auto horizontal scrolling for our website using - jQuery.ScrollTo
Trying to develop using MVVM: I have this Csla.PropertyStatus control that is created in
I am trying to develop a application by using Cocos2d. I can't getting value
I am trying to develop a BlackBerry application that will show data from an
I am trying to develop an Android application and I heard that for someone
I am trying develop a basic referrer system to my Django website, system will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.