• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2101
  • Last Modified:

NAT Transversal - INDY / Delphi Source Code


Has anyone got some sample Delphi source code for NAT Transversal?

I am interested in getting our accounting application to run Peer-to-peer behind firewalls.  
It is already multi-tier with client / server using INDY.
  • 2
1 Solution
btanExec ConsultantCommented:
something useful may include
- How do I use Indy with a NAT (Network Address Translator)?


- Using Universal Plug And Play (UPnP) with Delphi (created a 'TNetworkDeviceFinder')
thought 'pwnat' may be useful reference as it is in .c though not Delphi - most codes are in C#
- pwnat, pronounced "poe-nat", is a tool that allows any
    number of clients behind NATs to communicate with a
    server behind a separate NAT with *no* port forwarding
    *no* DMZ setup, and no 3rd party involvement. The server
    does not need to know anything about the clients trying
    to connect.

- chownat, pronounced "chone nat", allows two peers behind
       two separate NATs with NO port forwarding and NO DMZ setup
       on their routers to directly communicate with each other.

- UPnP library that only covers the NAT aspects, and not even fully at that - only UPnP device discovery, basic port forwarding, and retrieving the external IP address.
btanExec ConsultantCommented:
Useful info


There are several different techniques for dealing with routers - NAT Traversal, Hole Punching, uPNP, Role Reversal, just to name a few. Skype, and most other peer-to-peer apps, utilize many of these techniques
Can I use Indy for dealing with routers?

Yes (in fact, Skype for Windows is written in Delphi and uses Indy, actually). What I described earlier are techniques, logic patterns, etc. They are not specific to any particular socket library, so they will work with any socket library you choose to use, whether that be Indy, ICS, Synapse, WinSock, whatever. As long as you have access to base TCP/UDP functionality, you can utilize them.
enigmasolutionsAuthor Commented:
Thank you.  That is great information.  Good enough for me to start the research.

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now