How to get Socket connect through proxifier - c++

I made a simple program in c++ for connecting to a site and loading a page HTML code or send data using GET/POST requests.
But now I want the program to connect and send/receive data through proxy.
You probably know software like NextVpn and proxifier. when they are running any application which tries to communicate through internet will have to go through these apps.
The problem is that my program connects and communicates directly and my proxy software doesn't interfere.
Communication is done by the socket programming routins (SOCKET class) like this
SOCKET sck=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
connect(sck,(SOCKADDR*)(&SockAddr),sizeof(SockAddr));
send(sck,myRequest,strlen(myRequest),0);
Any solution?
EDIT: The problem was from NextVPN not the Proxifier itself. It seems that NextVPN lacks functionality in hooking into some programs. First NextVPN finds the program which is trying to connect to a remote address then redirects it to its portable version of proxifier with something named "compose.ns" . Unfortunately it was unable or couldn't detect my app connecting to internet. Instead I used Proxifier itself and it successfully detected my app as it was showing in its connection list.

Related

boost.asio + native windows sockets

We have a framework that communicates via native WinAPI sockets (WSASend , CompletionPorts, etc) via TCP.
Recently, we've added some classes to this framework that also async sends and receives some messages via UDP, but these classes use Boost.ASIO (io_context etc).
Since then, we noticed that WinSocks connect function fails, with the following error:
A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection
failed because connected host has failed to respond. The thread 0x3038
has exited with code 0 (0x0)
This only fails when connecting to a remote computer, not locally.
When reverting to an older version without these Boost classes, everything works fine (ruling out firewall issues)
When the Boost.ASIO classes our used outside of the framework, they work fine.
We are unsure what causes this issue. My hunch is that it is a conflict on OS level between winsock and boost.ASIO.
Did anyone run into something similar? Any ideas or pointers would be really appreciated.
Ben

How to connect frontend and backend via tcp/ip?

I have a GUI (frontend, programmed in C++) and a kernel (backend, programmed in C++). Currently, the frontend is just linked to the backend library. However, due to performance reasons I want the functions from the library to be exceuted from another computer/server. The communication to the server shall be done via a TCP/IP connection.
The current idea to achieve this, is to set up a TCP/IP client/server connection. After the connection is set up the gui sends a header id and maybe additional data to the server, where the code is executed and the return is send back. However, to achieve this, I have to map every function to a header id and program the handling of the received data for every function in the backend. This is a tedious work, where I have to wrap each function manually.
The question is now: What is the common practice to connect the frontend to the backend via a server/client connection? And is there any generator (like SWIG for Python etc.) to generate a TCP/IP interface?

Multiple Simultaneous gRPC connections to different servers via different interfaces (eth0, wlan0, ppp0)

We have started using gRPC C++ for our embedded system project (ARM Processor Cortex-A7) as a client. We have successfully created a sample application which communicates with the server using protobuf.
We have a new requirement now. We have to open multiple connections to the different endpoints (or server) via different interfaces (like ethernet, wifi and cellular [using ppp]).
I tried to google but couldn't find any solutions to it. I have tried gRPC forum but hasn't received a proper reply to my question.
I have wondering if gRPC has provision to bind to a particular interface or IP. Linux POSIX socket provides SO_BINDTODEVICE option but I am not sure if gRPC has any application layer method or function to achieve it (can't find it in the documentation).
Or Can we achieve it via some other hack (may be by modifying the routing table?).

Socket communication between c++ Client and node.js Server

I want to make my c++ app (running on Linux system) to connect and send data to node.server via socket.
I tried to implement small sample app by using socket.io library (https://github.com/uning/socket.io-client-cpp), but doesnt helping me to achieve my goal.
Any guidance on this or alternative to do something like this.

How to incorporate ports / sockets for direct tunneling with p2p darknet app

I'm building an app which upon login will connect you to certain ip addresses of which will also be running the same app.
The method of which i believe i should be using is direct tunnelling but as i say im a little new to c++, i have general coding skills, and i have sifted through a lot of forums and sites yet im still very unclear on what the best way forward is to achieve the requirement.
The reason for the connection will be to enable a secure chat, file transfer, and update software auto when connected to the program admin.
All those that have the app installed will once authorised, will be connected to admin client, then from that client all available ip's to connect to will become available to slave clients, this will increase the network size avilable to all users.
so the app needs to be able to handle ports but not via a server, instead it would be direct.
The connections also must ideally be encrypted.
Im kind of looking for what the application RetroShare does, but in text app.
(This is using C++ within Dev C++)
so just to recap, What method should i use to achieve the above?
I would take a look at SDL net to start with, its really simple to learn if you have never done any socket programming before.
for a secure connection you will probably want to start with TCP and then once you get the hang of network programming, start looking at other protocols.
Hope this helped! and good luck.