Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Port Forwarding using Delphi

Posted on 2011-03-22
9
Medium Priority
?
3,282 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…

886 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