Announcement

Collapse
No announcement yet.

relative link to different port number

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    relative link to different port number

    Is there a way to make a relative link to a differnt port number?
    I'm trying to make a link that works both inside and outside of my home network.
    I've gotten it to work with a bit of scripting. by looking at the client's IP and my network's external IP and then writing the link accordingly. but was looking for an easier way.

    I have Snapstream's beyond TV (software based TIVO, serves on port 8129) and homeseer running on the same machine (port 81) (computer is named media)

    so internally i have
    <pre class="ip-ubbcode-code-pre">
    Http://media:81 and
    http://media:8129
    </pre>
    and from outside the network
    <pre class="ip-ubbcode-code-pre">
    Http://###.###.###.###:81 and
    Http://###.###.###.###:8129</pre>

    to jump from one server to the other, I have had to hardcode the whole address including the HTTP. Which then will not work from outside the network.

    #2
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by wes:
    Is there a way to make a relative link to a differnt port number?
    <HR></BLOCKQUOTE>
    Not that I know of. You are on the right track though by looking at the client IP and then writing the link accordingly.

    The way I do it is to look at the first seven characters of the client IP. If they equal "192.168" (my private network) then I write the link out using my private network IP with the port number. If not then I write the link using my public URL and port number.

    You also have the option of writing 2 sets of pages, one for the inside and one for the outside but I find the way you described much easier to maintain.

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>to jump from one server to the other, I have had to hardcode the whole address including the HTTP. Which then will not work from outside the network <HR></BLOCKQUOTE>
    The whole address should work just fine.

    Comment


      #3
      Wes,
      I'm a bit confused but why not simply use the WAN ipaddress all the time?
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        Joe's place- that's also what i did. an If .. then, and then wrote the whole address

        Rupp - I'm with Verizon DSL, and my IP changes frequently. normally like 3 or 4 times a week. Plus it makes it easier with passwords to keep it internal.

        I've got this working, but I was just looking for an easier way.

        Comment


          #5
          Rupp,

          You can hit your public IP from the inside of your private network? I can't do that. Once I'm in the inside, I can't go out and then come back in via my public IP. Although I know there is some kind of anonomizer (sp?) software you can install on your PC that will allow you to fake your router out.

          Comment


            #6
            If you set up the DNS server IP addresses on each of your computers and on your router, then you should be able to do access your internal computers via your external IP address or your domain name.
            Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

            Comment


              #7
              Joe,
              I'm not sure how it works but I'm sitting on my laptop (not literally LOL) and if I key in my wan ipaddress I get to RuppWorld just fine. I assume this goes out to the www and back in but frankly I do not know how internet routing works. I should pay more attention since that's what I do for a living.


              Wes,
              Are you running IIS by any chance. I set up an application variable to capture my ipaddress from a virtual device in HS and this way it doesn't matter what the address is as long as the variable is updated.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #8
                Using my best Vinnie Barbarino impression: I’m so confused!

                Rupp – I’m sitting on my butt (literally) and if I key in my public IP I get a “Page cannot be displayed” error. I know of others like you that can hit their public IP from the inside and I know of others like myself that can’t. I don’t understand it either. I’ve been told it’s a security risk to be able to do what you can do but I didn’t understand the explanation as to why. As each day passes I seem to feel dumber and dumber.

                Zoomcat – Can you explain further (or point me to a link) on how I would go about setting up the DNS server IP address on each of my computers and router? I’m not sure I understand what you mean. It’s always a pain for me to test my setup to see what others on the outside see when they come in.

                I think I need a nap.

                Comment


                  #9
                  I'm not running IIS, haven't gotten that far into it.
                  I'm using scott crevier's ip redirect, and so I just have to do a hs.devicestring to get my WAN IP.

                  Rupp, as an experiment to answer your question:
                  I tried streaming a file to myself using my WAN address. then unplugged the ethernet from my modem. the file continued to stream. so I guess my router (D-link) kept the connection internal.

                  Joe - make sure you put the "http://" in front of your WAN IP, Internet explorer gets confused without it.

                  Comment


                    #10
                    I use a D-Link router and in the WAN setup there are places for two DNS servrs. I can't remember if I put them there or if they were placed there when the router gets its IP assignment from the ISP. On the computer (XP) you go to the network setup and lan propertys. There highlight the tcp/ip line and click propertys. You may see the DNS servers listed there. If not, click advanced and add the DNS servers using the add setup. I assign IP addresses to all my computers (you have to do this on Linksys routers to enable port fowarding, not sure about the D-Link).
                    Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                    Comment


                      #11
                      zoomkat - Gotcha. Now I know what you're talking about. I must have had a brain cramp or something. I think I have it setup right or else I don't think I'd be able to surf at all. I'll double check everything though. Thanks.

                      wes - Yup, I do put the http:// in front.

                      Comment


                        #12
                        Here is a snippet from my webcam.asp script. It may provide some ideas for you:
                        <pre class="ip-ubbcode-code-pre">
                        ...
                        Dim myIP
                        ...
                        GetMyIP
                        GetUserIP
                        ...
                        Sub GetMyIP
                        myIP = hs.DeviceStringByName("Network IPDevice")
                        hs.WriteLog "MyIP", myIP
                        end sub

                        sub GetUSerIP()
                        dim userID
                        const inet = ":81/inetcam"
                        userID = request.servervariables("REMOTE_ADDR")
                        if (userID = "127.0.0.1") or (InStr(userID,"localhost")) or (instr(userID,"192.168.")) then
                        thisSession = "http://192.168.0.6" & inet
                        else
                        thisSession = "http://" & myIP & inet
                        hs.Speak "Someone is watching us from the web", true
                        end if
                        hs.WriteLog "Full Addr", "http://" & myIP & inet
                        end sub

                        </pre>

                        With this sample you should be able to figure out how to serve your pages and even get the user's IP (not shown in the sample).

                        Comment


                          #13
                          GDude,
                          Why do you have to go to that much code to simply view a WEB page? My router routes all the traffic so there is no need to do the LAN vs WAN ipaddress. All request come from the WAN and the router routes it to the proper LAN ipaddress.
                          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                          Comment


                            #14
                            Rupp, if you are using different ports on the same machine, it would be fairly easy to use a simpler method. But I, like some others, have multiple machines serving out different ports which are using port forwarding set up on the router, so that internal machines and IP addresses vary depending on the port being used, while externally they all look like one machine with multiple ports. Internally DNS or hosts file entries can't be used because the same name would have to point to 3, 4, 5 or more machines...

                            I chose to just use separate pages for internal vs. external. All internal pages check to see if they are actually being served to internal machines with authorized access and accounts. If not, unauthorized access.
                            |
                            | - Gordon

                            "I'm a Man, but I can change, if I have to, I guess." - Man's Prayer, Possum Lodge, The Red Green Show
                            HiddenGemStudio.com - MaineMusicians.org - CunninghamCreativeMaine.website

                            Comment


                              #15
                              Gordon,
                              Your loosing me a bit here. I have never ever edited my hosts file don't really know what it is used for to be honest. All I know is I plugged in my DLink router and I forwarded several ports to 3 different computers. Using the routers ipaddress and I can get to all of the sites no mater which machine it is on using my WAN (routers ipaddress) from my laptop located on the LAN. So why would I need separate lan and wan addresses? Sorry for being so dense here but I want to understand why this works for me and not others. TIA. Greg
                              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                              Comment

                              Working...
                              X