Solved

Port Forwarding using Delphi

Posted on 2011-03-22
9
2,948 Views
Last Modified: 2012-05-11
Hey,

I have to build an application that permits :

-1> forward TCP/UDP requests on port p1 to another IP machine on port p2
-2> enable multiplexing request on port p2
selecting either machine M1 with IP1 on port p2; or machine M2 on port p2; or machine M3 on port p2...

I think all this is possible using a server routing application that permit multiplexing
external users can use a client application that indicates which machine is to be connected on port p2

Any good ideas, or any examples are welcome
I am searching for an example with Delphi spource (7 prefered)


Thanks in advance

Laurent
0
Comment
Question by:llaurent59
  • 4
  • 2
9 Comments
 
LVL 9

Expert Comment

by:Mahdi78
ID: 35191328
0
 

Author Comment

by:llaurent59
ID: 35341716
Still waiting for a solution

or for an example that will permit me to make further tests...
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35341962
Did you try TidMappedPortTCP?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:llaurent59
ID: 35342853
No I did not,
Have you a first example with TidMappedPortTCP ?
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35343153
0
 
LVL 24

Accepted Solution

by:
jimyX earned 500 total points
ID: 35499225
I have shown the Author what to use to accomplish what he is asking for #35342853. Also I directed him where to find examples #35343153.

Also I have got a chance to write a simple example using "TidMappedPortTCP" if the Author is interested in details:
procedure TForm1.Button1Click(Sender: TObject);
begin
  IdMappedPortTCP1.MappedHost := IP Address;       // the remote address where the packets to be forwarded.
  IdMappedPortTCP1.MappedPort := RPort;                // the remote port where the forwarded packets are expected at.
  IdMappedPortTCP1.DefaultPort := LPort;                  // the local port where the local communication is taking place at.
  IdMappedPortTCP1.Active :=  True;
end;

Open in new window


I needed to forward a communication between a Client and Server from one PC to another, the Client is on my PC (IP:127.0.0.1 & port:123) and the Server is on another PC (IP:192.168.0.3 & listening port:112) so what I did is activating the "IdMappedPortTCP" with the following properties in my PC, where I have the Client:
procedure TForm1.Button1Click(Sender: TObject);
begin
  IdMappedPortTCP1.MappedHost := '192.168.0.3';
  IdMappedPortTCP1.MappedPort := 112;
  IdMappedPortTCP1.DefaultPort := 123;
  IdMappedPortTCP1.Active :=  True;
end;

Open in new window


After activating the IdMappedPortTCP all the communications were forwarded from the Client to the Server.
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35499234
Correction in a the post number that I am referring to:
I have shown the Author what to use to accomplish what he is asking for: #35341962...
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question