Google + PhotoHunt Java sample not accessible by ip - google-plus

I am trying to run the PhotoHunt Java sample, https://developers.google.com/+/photohunt/java. The problem I am seeing is the service can only be accessed by http://localhost:8888. Google + sign-in button works fine, so I assume all the configuration is correct. Buy if I try to use http://<some_ip>:8888, it is not accessible. Any advice?

Change the app engine server to run on a different port. Select the menu on the Eclipse Run button and then click Run Configurations. Select the tab for Arguments. Next, add the following line:
--address=<yourhostaddress>
And optionally set the port as well. The following screenshot shows a configured application.
Now when you run the application, it will serve on the assigned address and port.

Related

Can't use phone ase controller

I want to test my airconsole game on a smartphone before publishing. The problem is, I can't connect it to the simulator.
If i try to connect (Chrome on Android) it says connecting, after a few seconds it shows the enter code screen but no input is possible. After about 30 seconds I get the message download the app for next time. (Screenshots attached)
Do you know where the problem is?
My files are hosted on a webserver, accessible from everywhere.
Kind regards
Make sure your screen.html and controller.html are accessible from all devices.
Let's assume you are running your local web server on http://192.168.0.2:8080/
Try to access http://192.168.0.2:8080/screen.html and http://192.168.0.2:8080/controller.html using a normal web browser on the device that doesn't work. It should display the screen/controller html.
If you can't access http://192.168.0.2:8080/controller.html from your phone, but from your computer, make sure you are in the same network and that your router does not have "Client Isolation" activated.
If you are testing with real smartphones, make sure you do not use http://localhost/ or http://127.0.0.1/, because localhost is not your computer on the phone but the phone itself!
If you are still unable to connect your phone, you can use the ngrok tool to forward your local url. See our Ngrok Unity Guide for how to do this in the Unity Engine: https://developers.airconsole.com/#!/guides/unity-ngrok

automate electron based desktop app using testcafe not working

i am trying to automate tests for 'lens' electron based desktop application.i was following this link enter link description here to setup the test for electron app.This link expects a 'mainwindowurl' but application doesn't have any main page, but testcafe give suggestion of the mainwindowurl as an error so tried it works but am not convinced with the suggrstion urls ,but same way want to give fixture page url on the test what should be the url should i need to give? then have got one more error ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.Please can you guys suggest what to do?
Each and every Electron application has to navigate to a page after opening a window.
I guess that the mentioned Lens app is an Kubernetes IDE: https://github.com/lensapp/lens.
This app uses the BrowserWindow.loadURL function to navigate to the main page:
https://github.com/lensapp/lens/blob/a61425124f18b1cc2d8a507084a472029acc3e6b/src/main/window-manager.ts#L101.
Digging the code a bit more, I found that the main window URL is just localhost with some port:
https://github.com/lensapp/lens/blob/a61425124f18b1cc2d8a507084a472029acc3e6b/src/main/window-manager.ts#L33.
I guess it is possible to determine or set the port number by looking at the code a bit more or asking Lens developers about it.

How to run Play Application on Apache 2 server?

I'm completely new to this, so please forgive me.
What I have right now is a Play application that, when I run play run on my personal Mac the site launches on localhost:9000 and everything works fine.
I also have a server running CentOS that tells me to "add content to the directory /var/www/html/" when I navigate to it's IP, but I don't understand how I can do that with a Play application? It's not like I have a bunch of HTML files I can just put there?
So my question is, what steps do I need to take to make it so if I go to the IP of my server, it takes me to the website I made and that is currently stored on my Mac?
You need to configure Apache as a "proxy" to your Play application (that's why you won't need to put anything into /var/www/html/).
Your application code can be uploaded anywhere you want on the server. It will need to be started on the server (with play start for example) and Apache will "forward" requests to the running Play application.
You can look at the Play documentation in the "Deploy your application" section :
"Deploying your application" (general recommandations) : https://www.playframework.com/documentation/2.6.x/Production
"Set-up a front-end HTTP server" (explain how to deploy Play behind Apache or Nginx) : https://www.playframework.com/documentation/2.6.x/HTTPServer

Does IntelliJ have an internal web server to serve static content of a web application?

Right now, the directory of my module is defined as an IIS virtual directory and IIS serves the files.
I was wondering whether IntelliJ has an internal web server, which can serve the files, without the need for any third party. Eclipse does.
UPDATE: built-in web server is available in the recent IntelliJ IDEA versions (starting from 13). You can find more details in the blog (yes, this feature first appeared in WebStorm).
IntelliJ IDEA has no this feature, you need to install and use any third-party web server that can serve the content from the project folders.
A built-in HTTP preview server will be part of Intellij IDEA 13 and is already available in the EAP: http://youtrack.jetbrains.com/issue/WEB-7148
"All existing actions — preview in browser (pop-up over html file or menu action or
shortcut), open in browser and create/debug html file action now open file on built-in web
server
http://localhost:63342/<project name>/<file path relative to source or content root>"
In other words, right-click on an HTML page and select "Debug" or "Open in browser", and IDEA 13+ will serve up that page via port 63342.
Here's another super simple option, install Python: http://www.python.org/getit/
Then open a shell prompt, navigate to your root web folder (e.g. public) and run python -m SimpleHTTPServer - This starts an HTTP Service on port 8000.
Further reading should you need it: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
I've got mine running on Windows 7 but the above article still applies.
Another option is is create a PHP project that, starting with v 5.4.0 of PHP includes a built in web server. This page explains it all ...
http://www.jetbrains.com/idea/webhelp/php-built-in-web-server.html
IntelliJ IDEA has a built-in web server that can be used to preview and debug your application. Just watch this YouTube video or follow the steps below.
Option 1
You need to add new 'JavaScript Debug' configuration:
Click Add Configuration... or Edit Configurations... in the Navigation bar
Click button in the toolbar or press Alt + Insert to create a new configuration
Select JavaScript Debug under the Templates node in the tree view of run configurations
Fill in Name, URL, Browser and click [OK] to save the configuration
Use http://localhost:63342/YOUR-PROJECT-NAME/index.html for URL
Now you can run the configuration:
Click run or debug button in the Navigation bar (or use Shift + F10 / Shift + F9 hotkeys).
Option 2
Running web page in browser without creating a configuration. Refer to the related IntelliJ IDEA Help article.
In the editor, open the HTML file. This HTML file does not necessarily have to be the one that implements the starting page of the application.
Do one of the following:
Choose View | Open in Browser on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
Hover your mouse pointer over the code to show the browser icons bar: . Click the icon that indicates the desired browser.
Result
Google Chrome browser with a demo web page served by the Intelij IDEA's built-in webserver:
One simple way is to create a NodeJS / Express project in IntelliJ that is your web server. You can then use it to serve your static web pages and any other web content. The NodeJS web server is very small and runs fast - noticeably faster than IIS and Apache. Best of all you can just hit the Run button in IntelliJ or WebStorm to start it up.
By default, a NodeJS / Express project includes a public/ directory that you can use to contain your static pages that you can then view from http://localhost:3000/
This explains the steps required to enable NodeJS in IntelliJ and includes links to other Node resources:
http://www.jetbrains.com/idea/webhelp/node-js.html
If you feel the need, you can reconfigure your NodeJS server using server side Javscript code. You can add SSL support or almost any other server side features you care to dream up. Just add NodeJS modules using the npm (Node Package Manager) command line tool included with the install. NPM Registry https://npmjs.org/ indexes all the available modules.
You can configure IntelliJ to use a lot of different application containers, but each of them must be downloaded and installed separately. I currently have mine configured to serve via jetty, like eclipse, and also tomcat, tc-server, jboss, and node.js. It's pretty easy to set up.

how to test open graph on localhost

I've done a lot of research and haven't found a definitive answer to this. Is there anyway to test the open graph on localhost? I don't haven any issues using the graph api on locahost.
I've changed my website url in the app settings and have even tried setting up a domain in my hosts file but the debugger linter for open graph tries to use the actual domain instead of my localhost and when using locahost directly the linter completely fails connecting.
Does anybody have any workarounds for this?
Using a local proxy is the right solution. ngrok didn't work for me neither.
A similar tool that did work with facebook debugger is localtunnel ✅
npm install -g localtunnel
lt --port 8000
# or using npx without installing localtunnel
npx lt --port 8000
Generates a url that looks something like https://<random_hash>.localtunnel.me/. Using this url in facebook open graph debugger worked for me as of October 18th 2017. I only had to hit Fetch new scrape information button. 🍻
Cool thing about localtunnel is that you can easily host your own localtunnel server with github.com/localtunnel/server so if it ever stops working with localtunnel.me, you can run your own somewhere in the cloud ⛅
You can use ngrok to create a random public subdomain that routes to your local webserver very easily, even through NAT or firewalls.
Just download ngrok and run ./ngrok http 8080 (assuming 8080 is your local webserver http port).
This will create a random subdomain like http://38a84a97.ngrok.io/ that routes to your local webserver and that you can use with Facebook to test your open graph tags.
Its very simple to test Open Graph in any local environment using Chrome or Firefox using plugins. I have used one to quickly show in chrome how the Open Graph looks to the viewer to test results. Here is a quote of what it does.
This extension shows how people will see your site in the most popular
social networks This extension is for professionals who creates a
media content.
To check meta-information of your site or article just open it in a
Chrome and click extension's icon. Also you could add an URL manually.
Here is a direct link to the plugin (Chrome)
Firefox add-on
As a bit simpler approach you can use a browser extension like https://socialsharepreview.com/browser-extensions - which will show your Social Cards directly in the Browser (which of course might fail, if you wrongly didn't set them serverside :))
To test open graph (and Twitter cards) I also had to expose localhost (Docker) to Facebook and Twitter. I used Serveo
It works very well for this, no need to install anything as it works with ssh port forwarding.
$ ssh -R 80:localhost:3000 serveo.net
Then navigate to the url given, and there you go.
You have to setup a public domain which points to your public ip address.
Use dynes.org or a similar service and setup your router to forward your port 80.
There are several tools you can use for serving something up over your localhost, each with varying degrees of functionality.
I prefer (obviously) http://forwardhq.com
Other great options here: http://devblog.avdi.org/2012/04/27/http-forwarding-services-for-local-facebook-development/
If anyone is looking to preview the :og tags on while developing on subdomains (using lvh.me) in localhost. You can use https://serveo.net.
Simply use following command to forward your local server requests. No installation required.
ssh -R yoursubdomain.serveo.net:80:yoursubdomain.lvh.me:3000 serveo.net
you can put your desired port in place of 3000.
Reference: https://blog.aarvy.me/2019/09/20/expose-local-apps-having-subdomains-to-web/