Search code examples
airconsole

Using Airconsole on a standard University/Corporate network for dev


I tried to make an airconsole game at my university. Unfortunately like nearly all universities devices are not able to see each other on the network. That means I can't serve pages from my laptop to my phone. So, the standard

http://www.airconsole.com/#http://<myipaddress>:8080/game/

Does NOT work. This makes it impossible for university students and people at game jams at universities to make games for airconsole.

I even tried setting up a remote server at digital ocean, uploaded my code there and then using

http://www.airconsole.com/#http://<ipaddressofdroplet>:8080/game/

Even that didn't work. Since I was on a deadline (Global Game Jam 2016) eventually I just gave up.

Is there a workaround or is making games for airconsole on a typical university network just impossible?


Solution

  • You can use tools like https://ngrok.com/ to make your localhost public even if there is client isolation.

    Let's say you are running your game on http://192.168.0.36:7842/ and http://192.168.0.36:7842/controller.html is not accessible from a your smartphone.

    Then run the following command:

    ngrok http 7842
    

    This will output you something like

    Tunnel Status                 online
    Version                       2.0.19/2.0.20
    Web Interface                 http://127.0.0.1:4040
    Forwarding                    http://8941ec1a.ngrok.io -> 192.168.0.36:7842
    Forwarding                    https://8941ec1a.ngrok.io -> 192.168.0.36:7842
    

    You can see that http://8941ec1a.ngrok.io now forwards to http://192.168.0.36:7842

    Now start your browser on: http://www.airconsole.com/#http://8941ec1a.ngrok.io/ and you should be able to connect your smartphone.

    Note to Unity Developers: You need the latest airconsole unity plugin from www.github.com released on 2016-02-01 and you should select "Normal" as the browser start mode.