0

I'm using broccoli to develop a simple app and I'm trying to access it from a mobile phone. However, even if I'm able to access the site from my computer at localhost:42000 I'm not able to do so when I point the browser of my phone at 10.0.1.8:4200.

Is it possible to access the broccoli server from other devices? If not, how do you suggest me to handle this issue?

Thanks

Sig
  • 5,476
  • 10
  • 49
  • 89

2 Answers2

1

Well, localhost is 127.0.0.1, which is not accessible from outside your computer by default, but... You can use a development proxy like Pow to fix this.

Pow is very simple to setup and configure to your needs and apart from that awesomeness it can serve your apps to other devices on the same network.

What you need to know before you proceed with the steps below:

  1. Your computer's IP address on your LAN.
  2. The name of your app.

For the example steps below let's use the following values.

  1. IP: 10.0.1.8
  2. App name: magicapp

Steps to happiness (if you run OS X or Linux):

  1. Install Pow with: $ curl get.pow.cx | sh
  2. Tell Pow to look for your app at localhost port 4200 with: echo 4200 > ~/.pow/magicapp

VoilĂ . If all went well, you should be able to access your app from other devices on the same network at: http://magicapp.10.0.1.8.xip.io/

Hope this helps.

eploko
  • 5,347
  • 2
  • 28
  • 23
1

You could simply launch the broccoli hosting server via

broccoli serve --host YOUR_IP --port YOUR_PORT
Undo
  • 25,519
  • 37
  • 106
  • 129
Roger Jin
  • 553
  • 5
  • 15