I'm developing an app at OpenShift which consists on a node.js gear and a php gear.
The node.js gear must communicate with the php one, so for now, in node.js i'm just doing a normal http request to the php gear.
But I read there is a routable IP to intercomunicate gears through port 8080 using HTTP (https://www.openshift.com/forums/openshift/intra-gear-instance-communications) but have no clue on how to get that IP.
I have looked at env vars but there is nothing and using the domain name or the loopback IP does not connect on port 8080.
Any idea on how to get that IP or what i'm missing?
Thanks.
Related
How to access localhost (xampp) Server from another computer over LAN network ,
I installed XAMP version: 7.2.10
Also from my local host , I have a php application/page which connects to a page in the internet (hosted outside the local host) and i want to get response from that page through gateway when I call that page by post/get method .
how to do this?My Local Network is limited to internet connection
Bind your apache to the LAN IP(e.g. 192.168.0.XXX, 10.10.1.XX).
Make sure you allow in your firewall inbound connections on port 80 (or whatever the port your apache runs on).
Configure your virtual host with Server Alias
As long as you don't have restrictions on the LAN you should be able to access the local webserver from the LAN using http://
In regards you your second questions, if you query the external page/resource synchronous you will get the response without problems. If you will expect an asynchronous response, you will need to prepare a bit more and expose your apache port to the internet via a NAT port forward(you will need access to the LAN router) and set your callback to the public IP:port/path
I am developing a symfony project on my local machine, I wish to test it on my mobile via IP (both machines connected to wifi network). how do I access port 8000 (symfony's default port) on my mobile phone?
I already know about accessing localhost via IP of the serving device, but I want to access the port too(8000) which I cannot fetch from my devices!
Thanks for all the help
As answered to another Question this might be solved when adding the parameter 0.0.0.0:8000 to let Symfony not only respond to local requests but also accept requests from other devices.
The call then should look something like this:
php bin/console server:run 0.0.0.0:8000
Same way you accessing it from your local machine but using it's IP address e.g.:
http://192.168.1.2:8000
where 192.168.1.2 is your machine IP address in local network (check it using ipconfig command - on Windows or ifconfig on Linux/Mac OS X). Please make sure your firewalls (on local machine and on router) does not block this (8000) port.
UPD: By the way, as far as I remember, Symfony's default port is 8080, not 8000. Please check it carefully.
I register in the Openshift.com and create a catridge. But when I need to deploy Mosquitto, a MQTT Server, which is accessed through tcp or ssl protocol, and I need visit from public IP.
Does Openshift just redirect http/https protocol through 80/443 port to 8080?
Is it possible to use socket communcation in Openshift?
I have created two applications in Openshift, one for push and the other for web deployment, and I stopped the apache service in order to let the mosquitto service listen to 8080. But only if I send post request in https protocol, It can access to the server for a while and disconnect.
I think this might point you in the right direction https://www.openshift.com/blogs/paas-websockets.
To save some readings from the readers, the steps involved in niharvey's answer:
Create a diy app in your openshift account.
Git checkout the code.
Add a websocket app of your own choice that would bind to $OPENSHIFT_DIY_IP:$OPENSHIFT_DIY_PORT.
Modify the action hooks for starting and stopping your app. Push the code.
From the client, connect to port 8000 for ws:// or 8443 for wss://, by your app url.
Just verified these steps do work as expected.
I have two sites. One is remote (online) and another localhost (on my developer machine).
The remote site in on dedicated IP address XXX.XXX.XXX.XXX and the localhost machine is public IP YYY.YYY.YYY.YYY. The remote site is a wesite running online like any other internet site.
Both remote and local machine are running mysql db and PHP.
What I need is to have the remote site (on the internet, IP address XXX.XXX.XXX.XXX) connect to my local machine (with the public IP YYY.YYY.YYY.YYY) when some specific webscripts are run by visiters to my website.
How do I establish a connection to my localhost from the remote website using PHP?
Please note that I'am asking for the opposite of normal practice of having a local machine connect to a remote machine.
You will need to configure port forwarding or a DMZ on your router. Port forwarding on port 80 will probably be easiest and more secure (it'll stop web traffic on other ports connecting to your PC which a DMZ would otherwise allow).
The process for setting up port forwarding differs from router-to-router, but it should be relatively easy to find in your router's admin panel. Find the private IP of your PC and, in your router's config, set up so all requests on port 80 to forward to the PC's internal IP.
I am in the middle of building a website which means it is not uploaded to a server yet. Is there any way I can perform cross browser testing from the localhost and not an actual hosted URL?
Either by running lots of browsers natively (some in a VM), or by using SSH tunnelling to a commercial service like browserling (http://browserling.com/).
Edit to elaborate a bit: An SSH tunnel (a reverse tunnel technically) between your localhost and a server allows you to forward certain ports on the remote host to ports on your localhost, over an encrypted SSH channel. This means the browsers running on browserling's servers can send packets down the tunnel, back to your localhost and your webserver there.
Install PHP on your local machine, this way you can run PHP scripts in command-line or browsers.
http://php.net/manual/en/install.php
Configure your webserver to listen on your network IP and access your website through IP address on your local network.
If it is apache webserver It would be configured using directive:
Listen IP:port
Example 1 (your adapter IP address):
Listen 192.168.1.10:80
Example 2 (global listening on all interfaces) - better for testing
Listen 0.0.0.0:80
Then just simply access your computer from other browsers on other platforms.
Sure. If you're able to configure your local network you could expose port 80 or 443 to the cloud by making changes to your routers firewall. This would make your application as available for testing locally as any on a remote host.
Let me know if your question is about which tools you could use, either as external services or locally installable.