Jump to content

How to bind to a specific IP address


MarcoC

Recommended Posts

Hi all.

Standalone Windows application, Delphi 10.4.2, UNIGUI 1.90.0 build 1568

On a Windows server with two public IPs I want that my Unigui app uses port 443 on a specific IP (port 443 is already occupied on the other IP, so I can't use it).

On the production build, Server Module, OnBeforeInit event, I've put this code

{$IFDEF Produzione}  /// ////////////

 SSL.Enabled := TRUE;

//kill the standard bindings
 Port := 0;
 SSL.SSLPort := 0;

 //create specific bindings
 Bindings.Clear;
 with Bindings.Add do begin
   IP := '54.76.228.197';
   Port := 443;
 end;


{$ENDIF Produzione}

Once deployed I always get a "Could not bind socket error" seems as port 443 is already in use, but it should be used *not* on 54.76.228.197, is my code wrong or have I to dig more on the Windows Server configuration?

Thanks for your help.

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Unfortunately, I think you are asking the wrong questions that nobody can answer.

To start off :

-          Can you confirm that your app has been tested successfully on http://localhost and on which port.

-          What url are you to trying to use for the deployment?

-          Are you using the hyper-server for deployment? If not, I strongly suggest you try that because it takes care of all the SSL and  port issues and you don’t have to configure anything in the server module. The docs on this are very easy to follow.

What I can tell you is this:

-          Forget about the fact that your server has multiple IP’s because that is irrelevant. Which of the external IP’s is used is determined by the domain (url) of your app.

-          Forget about port 443 because your app has no control over that. This is an external port that all https traffic travels over. As long as your app is configured for SSL your firewall will do the rest.

-          There is nothing wrong with multiple SSL configured  apps using the same external IP. So you can serve multiple SSL apps over any one of your server’s IP addresses. The firewall will deliver the traffic to the correct app based on the app’s internal port binding.

Feel free to contact me directly and I'll try to help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...