Solved

Port Forwarding using Delphi

Posted on 2011-03-22
9
2,813 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
We've been using the Cisco/Linksys RV042 for years as: - an internet Gateway - a site-to-site VPN device - a leased line site-to-site subnet-to-subnet interface (And, here I'm assuming that any RV0xx behaves the same way as an RV042.  So that's …
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now