Cannot Preview on LAN

0 favourites
  • Hi everyone,

    I followed the instruction from https://www.scirra.com/tutorials/247/how-to-preview-on-a-local-network/page-1 Everything went smoothly, except when I tried to view it on my phone, my phone browser says the webpage is not available. I read the comments at that section, and it seems a few had the same problem. A few mentioned that it might be due to the IP changing, I checked mine but it is still the same. I do not get any errors or problem viewing it on my computer.

    My computer and phone access the Internet through my wifi. I've never tried accessing either from the other through wifi or network so I am not sure if I was supposed to set something.

    I am really a noob at networks so please forgive me if I did a dumb mistake.

  • Double-check you set up the firewall correctly, and possibly also have a look at Troubleshooting Construct 2's preview server.

  • Hi Ashley,

    I had a look at the page you recommended, and I tried the refreshing browser, checking firewall (did earlier from the initial setup), changed ports, running construct2 as admin, preview on lan (this was what I followed earlier, and review the hosts file. But still the same error on my phone's browser.

    I wanted to check with you, when you mention changing browsers, were you refering to the browser on my computer or phone? Cause there shouldn't be a problem on my computers side since it had no issues with C2 all this time. Also, when I try to preview it on LAN, my computer's browser is fine and runs the game with no issues, it's just that my phone gets the error message.

    Please do advice <img src="smileys/smiley19.gif" border="0" align="middle" />

  • I'm afraid it's hard to help, because it sounds like some router or firewall specific configuration is blocking access to the host computer from other devices on your LAN. It all depends on your particular setup.

  • You mention in your first post you have the same IP still.

    But, after you installed construct 2, in preferences, tab exporter, you need to change the "localhost" to the IP adres of your computer for preview over wifi.

    If you have not changed this, it won't work.

    just thought I bring it up seeing your statement about networks.

  • Ashley, thanks, I will try researching for firewall settings and also take a look at my anti virus, perhaps it is blocking access. Will update as soon as I can here.

    Sorry, my fault for not explaining it clearly. I noticed people mentioning that our IP address are dynamic and can change, which could lead to problems previewing it. I checked and my IP address is the same and is the correct one set inside C2 preference.

    I have already set up C2 preferences according to the guide. Everything works perfectly on my computer end. Indeed the browser does not display localhost anymore, it shows my ip address.

  • Ashley,

    I tried to do some research but with no luck, in the end I tried a few websites to check if my ports are open, using websites like canyouseeme.org and grc.com

    It mentioned that none of my ports were open. GRC mentioned that all my ports were in stealth mode, which they say is a good thing in terms of security, but I am wondering if this is also blocking the preview? They auto detected my IP address which is different from what I see in my network settings.

    Also, C2 preference options listed only one IP address which I selected. I checked my network connection and that is indeed the IP for my computer. My router uses a slightly different IP. But the correct one if indeed the IP for my computer right?

    Lastly, my phone uses the same wifi internet as my computer, and there is no problem accessing the Internet from my phone. So it shouldn't be a setting within my router right?

    Sorry, if I am rambling, I am a bit desperate. My game system is complete and I want to test to make sure it runs ok on the phone before making all the graphics for it.

    Would really appreciated any help on this <img src="smileys/smiley19.gif" border="0" align="middle" />

  • When you preview your game. Your browser will display the IP and port that it is using in the url bar. Type that number in on your phones browser.

    Also, the preview must be running on your computer before you try to connect with your phone.

  • Have you tried starting your construct as admin ?

  • Port scanners won't help you. They'll just show you what your router exposes to the open web, rather than your internal LAN configuration.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Tekniko, yup I typed the exact url from the preview window, the one with my IP address along with the port number. Yes, I run the preview first before trying to preview on my phone. I tried refreshing on both ends as well, and even go a bit deeper into the game as well with no luck.

    lennaert, yup I run C2 as administrator every time.

    Ashley, thanks for that. Sorry, I am really bad at networking. I will try searching for information on checking the LAN ports. Will update as soon as I can.

    Thank you guys!

  • I've never got my lan working (with construct2 preview) and my mobile.

    My work-a-round is using wamp or *xampp and having a directory for games. I just export html game there and run game from my mobile using wifi and network.

    *my current favorite

  • DUTOIT, thanks I really appreciate it! I will give C2 preview a few more tries, but if I can't I'll use your approach. Again, thanks! I think I must have gone a few years bald just last night <img src="smileys/smiley17.gif" border="0" align="middle" />

  • rekjl,

    No problem :)

    Trust me its not you, I'm pretty good at networking etc, but for some reason I can't get C2 and my LAN to work. I've tried countless times in the past.

    But, my work-a-round suits me better now.

    I have my development sites there, my mysql databases, and now my game(s) which I can test to my hearts content.

    The preview is great for little changes, because it takes slightly more time to hit the export button and select folder, and wait for it to export - lol. But, at least I am seeing the real game it its exported state vs a preview.

    Wamp and Xampp can be a little tricky - have a look at Instant Wordpress. Its a standalone, portable WordPress development environment. It turns any Windows machine into a WordPress development server. It will even run from a USB key. Create a folder in your wordpress directory.

    Nice trick: edit your hosts file turning your localhost and ip 127.0.0.1 to a url example.com or I use myactualdomain.dev

    Anyways good luck, have fun

  • DUTOIT, hehe just in the nick of time. I just installed XAMPP and I think I stared at the instructions and guide for a solid 30 minutes with a blank mind. Hehe I will download instant wordpress now.

    Just had a look at it, and I just want to ask and see if I got the idea correct. Instant Wordpress is used to view wordpress websites. But it should work with html in general, that is why I will be able to test my html5 game by placing it into the correct instant wordpress folder?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)