Access remote IP address homepage remotely through webserver - php

Scenario:
My company network has a machines with dedicated IP address. When we enter each IP on our browser within the company network, it takes us to the machine diagnostic page. What i am trying to accomplish is to access these machines remotely from our webserver. I tried adding a link on our website with 10.116.192.5 and it obviously didnt take me to the machine because i was out of that network. Is there anyway i can access these IP on my office network through our website?
I tried using cURL but that does not work with java applet. So i am trying to find an alternate solution to it.
Would using iframe work in this scenario?
Rephrasing the scenario: Trying to redirect our website URL to point to an internal IP address URL. So for instance, if a client types www.scada.example.net/userinfo on browser, this would redirect on the server side internally to x.x.x.x and display on the client side as www.scada.example.net/userinfo.

Related

In my PHP Script REMOTE_ADDR gives my true address but using whatsmyip in Google shows my VPN address

I seem to be getting different results when I check my IP address while connected to my VPN and accessing my web server than I get when I do a whatsmyip Google search.
When I dont have my VPN connected (on my laptop in a remote location) and I access my web server, my PHP returns the ip address of the hotspot I am connected to where I am staying and the same address is shown when i google WhatsmyIP.
However, when I connect to my VPN, the Google WhatsmyIP shows my VPN public IP which is whats I expected but no matter what I try, my web server with my PHP script using the server variable of getenv('REMOTE_ADDR') that shows my public IP keeps showing the actual hotspot public IP and NOT the address that my VPN is broadcasting. My web server, if it makes a difference, is Microsoft IIS running on Server 2016 Standard.
My VPN server is running on my work network main server (also the web server) using Server 2016 and its inbuilt remote access services and I am using the built in VPN connection with Windows 10 on my laptop where I am staying.
Normally I would be thrilled that my script shows a users real address however when accessing intranet sites that are restricted to IP addresses on the work LAN, when I use my VPN or if I dont, it still sees me as a remote user and I cant find a way to see me as a local Intranet connected user with a local address of 192.168.1.xxx.
Other posters here and elsewhere have posted the exact opposite and are asking for how to get the true IP of incoming connections but maybe I am missing something but I have the exact OPPOSITE problem.
Does it have something to do with the fact the VPN server and the web server are on the same server and IP address ? Perhaps the VPN knows the true address being used to connect and it is passing that through to the PHP script through the web server. If this is the case, is there anything I can do to stop this without moving the VPN server to a different server than the web server I am accessing for its intranet content ?
Your true IP address is your public IP. IP address on the range:
1. 10.x.x.x ClassA
2. 172.16.x.x Class B
3. 192.168.x.x CLass C
Are private addresses that uses a NAT or PAT to get a real public address(your router address). This private ip addresses are not for public use. You can't route any traffic on the internet to an ip address 192.168.0.2, you can only route those ip inside your network. When you visit your page your having the expected result, your public IP.
hope it helps.

PHP server on PC

I want to make a php application and it must host in a computer and open from many branches of my schools using web.
I installed XAMPP on my pc server, and if i try to open the application in the same LAN network it works, but if i change the network it is not working.
The browser say that ip 192.168.1.22 take large time to load and not open.
how can i config that problem please
You need to set up a static IP on your machine, then set your router to forward ports so that all requests that come to your router on a particular port would be forwarded to your machine. This should do for testing purposes, but if you want to host a website for example you will need to get a permanent static IP for your router, this usually costs money from your ISP(internet service provider).
192.168.1.22 is your local IP address, you cannot access it from a different network. You can get your external IP address for example using whatismyip.com. Also, if you are behind a router, you have to open and forward the port which is used by your web server to your machine.

Instagram redirect-uri fails for localhost

I am writing a PHP app to fetch all my photos with Instagram using their API. However, what puzzles me is, I run the app on my hosted server it works perfectly fine and the same app running locally does not work.
Here are some points on the app workflow:
The user sees the homepage and he will be prompted with 'sign-in with Instagram'
User signs in with Instagram and authorizes the app.
Instagram redirects the user.
The app then makes a request for access_token and receives it.
Using the access_token, the app will send further requests for user media
The response is parsed and the links to the images are now provided to the user.
All the above mentioned process works fine on my hosted server but fails at 'Step 3.' and redirects user to home page of my app.
The problem is localhost being the redirect_uri. Does anyone have a solution to this problem to use the app locally?
P.S: I have registered two separate clients on Instagram: one for locally hosted development and the other on a web server.
Also, I have tried localtunnel. Did not help either.
I know its a very very very old Question. but for those who get to this page hoping a solution:
instagram currently does not allow to use something like localhost or myvhost.test in redirection url, whats more it requires the url to be certified (https).
so the only working solution I could find is using ngrok. you should download it from the url, open it and type a localhost virtual domain name along with a specific port number like ngrok http myLocalUrl.test/app 80, hit enter and it will gives you two temporary public links.
it will remain valid until you close the ngrok command line. you can direct the link to a specific port number and direct the port number to specific folder path of the application in your localhost.
the tutorials provided by ngrok is simple enough if you did not understand my hints.
I was dealing with this issue trying to develop an Instagram App using NodeJS/Express.
I got around this by using my computer's external local IP rather than localhost, which you can grep for. I assume you're on a *nix machine, so do a very simple (and crude)
$ ifconfig | grep inet
which will return you a few ip and MAC addresses, one of them being your external IP. However this is lousy because it means every time you switch IPs you'll have to update your application's redirect_url with Instagram as well as update any code that relies on it.
Thankfully, there exists services like no-ip that will basically provide free DDNS service to you, so you need simply register a hostname with them and then drop that into your DEV env code as well as your development client's redirect url and you're set to go!

Find the IP address using as3 and server side technology

I am trying to find the IP address using as3 in adobe Flash professional cs5.5 and I think it is not possible from AS3 without using any server side technology(maybe I am wrong).
But I don't know any server side technology like PHP..etc.
Can anyone provide an example?
you can get the Local Machine using JavaScript. and also you can develop server side script which will retirve your local machine IP address from request header.
But as per your comments on your question I think you required your local machine IP. it will be get using javascript. But this IP address is not gateway or server side displayed one. Because in home or some fire wall / proxy user has different IP to access internet and local mahcine ip will be LAN IP.
and Javascript code you can call using the External Interface.
Please search for Javascript and ExternInterface code example you will find out many code example through google.
There's a simple and clean way to dynamically get the domain name, but not the IP, of the server hosting the SWF file.
You can use the domain property of the LocalConnection class.
try:
import flash.net.LocalConnection;
var lc:LocalConnection = new LocalConnection();
trace(lc.domain); // Outputs domain name of the hosting server, or `localhost` if ran locally.

accessing php file on a computer from another computer via internet

i have php files on my computer and i can very well access those from IIS using eighter localhost or loop-back address . But now if i want to access the same file of php from another computer not in the LAN but in a different computer on the internet what should i do? i was thinking of IP address(static) as an option but then i was not successful in finding a way to do the same .
thanks in advance....
I don't completely understand your question. Is your problem
1) You don't have a static IP? Then:
There are services as "No-IP" where you can create redirects. At their site, you can create a free domain name (which is a static IP as well) such as yourdomain.no-ip.com. Then on your server computer you can run their tool. This tool updates the IP all the time so it will be always correct.
2) You don't know how to access the server from out of the LAN because the IP of your network is the same for all computers (if you're looking from the outside)? Then:
Check your router settings, normally at: http://192.168.1.1. There you will be able to define rules how to redirect requests from the outside. For http, you should redirect requests to port 80 to the IP of the server computer (note: you can even use an other port on the server computer)!

Categories