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

  • SEARCH
  • Home
  • 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 8215833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:55:07+00:00 2026-06-07T11:55:07+00:00

I’m making a web application fuzzer and for my proxy server, I’m using opensource

  • 0

I’m making a web application fuzzer and for my proxy server, I’m using opensource code (for now) developed by a guy named Alex Ott. I’ve noticed though that when I make requests from some websites that those don’t get captured so I really want to write my own proxy in C++ but I have absolutely no idea where to start. Could someone explain it to me?

The end goal is really to be able to capture and write every request that comes through the proxy to a file, which I’m already doing but the proxy server I have now isn’t catch all this requests, ones I know to be there.

Edit: Since the question was unclear, here it is: I want to know what the code is for a proxy server written in C++ using the Boost extension libraries. Same question for the past four months.

  • 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-06-07T11:55:09+00:00Added an answer on June 7, 2026 at 11:55 am

    Well, here’s a somewhat functional example to get you started. It forwards between two connections. Note that this simple example won’t work for a web browser, as the client will attempt to make several connections, and this example only listens on one. Using this as a (very simple) base, you should be able to make some progress.

    The interesting stuff happens in handle_read, which is the callback that is executed when data is received. This function forwards the data between sockets. Notice that when we originally called it for the “local” and “remote” connections that the order we passed the sockets in is reversed (read_from and write_to).

    #include <iostream>
    using namespace std;
    
    #include <boost/asio.hpp>
    #include <boost/lexical_cast.hpp>
    #include <boost/thread.hpp>
    #include <boost/bind.hpp>
    
    boost::asio::io_service& io_service()
    {
       static boost::asio::io_service svc;
       return svc;
    }
    
    char local_data[1024] = {0};
    char remote_data[1024] = {0};
    
    void handle_read(
       boost::asio::ip::tcp::socket& read_from,
       boost::asio::ip::tcp::socket& write_to,
       char* read_buffer,
       size_t bytes,
       const boost::system::error_code& e)
    {
       // this function is called whenever data is received
    
       // for debugging purposes, show the data in the console window
       // or write to file, or whatever...
       std::string data(read_buffer, read_buffer + bytes);    
       std::cout << data << "\n";
    
       // forward the received data on to "the other side"    
       write_to.send(
          boost::asio::buffer(read_buffer, bytes));
    
       // read more data from "this side"
       read_from.async_read_some(
          boost::asio::buffer(read_buffer, 1024),
          boost::bind(handle_read, boost::ref(read_from), boost::ref(write_to), read_buffer, boost::asio::placeholders::bytes_transferred, boost::asio::placeholders::error));
    }
    
    int main(int argc, char** argv)
    {
       if(argc == 5)
       {
          boost::asio::io_service::work w(io_service());
    
          boost::thread t(boost::bind(&boost::asio::io_service::run, (&io_service())));
    
          // extract the connection information from the command line
          boost::asio::ip::address local_address = boost::asio::ip::address::from_string(argv[1]);
          uint16_t local_port = boost::lexical_cast<uint16_t>(argv[2]);
          boost::asio::ip::address remote_address = boost::asio::ip::address::from_string(argv[3]);
          uint16_t remote_port = boost::lexical_cast<uint16_t>(argv[4]);
    
          boost::asio::ip::tcp::endpoint local_ep(local_address, local_port);
          boost::asio::ip::tcp::endpoint remote_ep(remote_address, remote_port);
    
          // start listening on the "local" socket -- note this does not
          // have to be local, you could in theory forward through a remote device
          // it's called "local" in the logical sense    
          boost::asio::ip::tcp::acceptor listen(io_service(), local_ep);
          boost::asio::ip::tcp::socket local_socket(io_service());
          listen.accept(local_socket);
    
          // open the remote connection
          boost::asio::ip::tcp::socket remote_socket(io_service());
          remote_socket.open(remote_ep.protocol());
          remote_socket.connect(remote_ep);
    
          // start listening for data on the "local" connection
          local_socket.async_receive(
             boost::asio::buffer(local_data, 1024),
             boost::bind(handle_read, boost::ref(local_socket), boost::ref(remote_socket), local_data, boost::asio::placeholders::bytes_transferred, boost::asio::placeholders::error));
    
          // also listen for data on the "remote" connection
          remote_socket.async_receive(
             boost::asio::buffer(remote_data, 1024),
             boost::bind(handle_read, boost::ref(remote_socket), boost::ref(local_socket), remote_data, boost::asio::placeholders::bytes_transferred, boost::asio::placeholders::error));
    
          t.join();
       }
       else
       {
          cout << "proxy <local ip> <port> <remote ip> <port>\n";
       }
    
       return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.