Alpha Video Training
Results 1 to 4 of 4

Thread: How can I capture the server ip when using a load balancer?

  1. #1
    Member
    Real Name
    Greg Taylor
    Join Date
    Feb 2009
    Location
    Columbus, Ohio
    Posts
    442

    Default How can I capture the server ip when using a load balancer?

    I am using a load balancer and I am attempting to capture the request.host value of the server. If I use the ip address to access each server, I correctly grab the IP address as expected. When using the domain name, the load balancer always writes the domain name for request.host.

    How can I capture the server ip when using a load balancer? I am experiencing an issue that happens infrequently...I would like to save the ip address to a table field (mysql) as records are added to see if the issue happens on the same server.

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,696

    Default Re: How can I capture the server ip when using a load balancer?

    Request.Host is not set by the load balancer, but rather by the browser when the request is originated. As you have found out, it will always have the hostname portion of the URL.

    To get all of the IP addresses for the local (server) system, you can use the following Xbasic
    Code:
    dim hostName as c = System::Net::Dns::GetHostName()
    host = System::Net::Dns::GetHostByName(hostName)
    for each ipAddress in host.AddressList
    ? ipAddress.ToString() + crlf()
    next
    Last edited by Lenny Forziati; 02-22-2016 at 04:16 PM.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  3. #3
    Member
    Real Name
    Greg Taylor
    Join Date
    Feb 2009
    Location
    Columbus, Ohio
    Posts
    442

    Default Re: How can I capture the server ip when using a load balancer?

    Thanks Lenny!

    I appreciate you taking the time to help me with this....I am pretty sure I would never have figured that out on my own!

  4. #4
    Member
    Real Name
    Greg Taylor
    Join Date
    Feb 2009
    Location
    Columbus, Ohio
    Posts
    442

    Default Re: How can I capture the server ip when using a load balancer?

    Lenny

    Works like a charm...thanks!

Similar Threads

  1. How to get user’s IP address when using a load balancer?
    By Gatorfan in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 04-06-2015, 10:58 AM
  2. Software Load Balancer for windows [Commercial]
    By Mkpatil in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 03-05-2015, 10:34 AM
  3. Tracking user IP through a load balancer
    By mikeallenbrown in forum Mobile & Browser Applications
    Replies: 9
    Last Post: 03-28-2014, 11:07 AM
  4. Reports, Report Server, and Load Balancer
    By Steve Workings in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 12-01-2012, 09:12 AM
  5. Win NT server crashes on program load
    By Adrienne Boswell in forum Alpha Five Version 4
    Replies: 2
    Last Post: 09-06-2001, 08:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •