boot2docker is a virtual machine running on your computer. Your Mac is the host, and the boot2docker is the guest. The iOS simulator is also a "guest".
Guest machines can access the network in several ways. boot2docker is configured to use NAT, which in fact means that you can get from a guest anywhere, but you can only get to a guest from your host computer. The iOS simulator is not a host machine (it has its own IP address and its own network interface), so it cannot reach the boot2docker guest.
The easiest way is port forwarding. boot2docker instructions offer something like
boot2docker ssh -L 49155:localhost:49155
This will cause port 49155 to redirect all connections to port 49155 in the boot2docker guest system on the host computer (currently nothing is being done).
Now from the iOS simulator you can get to your server as if it were on the host: 0.0.0.0:49155 . If you are using a physical iOS device, you will need to obtain the external IP address for your Mac and use it.
An alternative to port forwarding like this would be to use Vagrant to configure the virtual machine yourself (running boot2docker or CoreOS or any recent Linux), and this virtual machine uses a bridged network (which makes the guest accessible from outside the host).
source share