Solved

Port Forwarding using Delphi

Posted on 2011-03-22
9
3,087 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

Limited time offer using promo code EXPERTS25

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through August 31, 2017, Experts Exchange members get 25% off the US7220 on the ATEN USA eShop using promo code EXPERTS25.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
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…
Suggested Courses
Course of the Month4 days, 14 hours left to enroll

635 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