Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Cannot serve the built app through an ad-hoc local network #244

@pc-magas

Description

@pc-magas

On my computer I've setup an ad-hoc wi-fi network and I have build a meteor app with the purpose of simulating a deployment to my pc and to see how an meteor build android app will interact with the server.

Therefore I typed I run:

git clone https://github.com/meteor/todos.git
git fetch
git checkout react
git pull origin react
npm install
meteor build ~/builds/todos --server=http://10.42.0.1:8080
cd ~/builds/todos/application/server
npm install
cd ../../

Afterwards I run:

ROOT_URL="http://10.42.0.1" MONGO_URL="mongodb://localhost:27017/superdb" PORT=8080 node main.js

I also tried:

ROOT_URL="http://10.42.0.1:8080" MONGO_URL="mongodb://localhost:27017/superdb" PORT=8080 node main.js

But both when I try to visit from another device connected to ad-hoc network using curl I receive:

HTTP/1.1 302 Found
Location: https://10.42.0.1/
Access-Control-Allow-Origin: *
Date: Thu, 24 Aug 2017 11:08:50 GMT
Connection: keep-alive
Transfer-Encoding: chunked

Also when I visit through browser in the computer connected to the ad-hoc network for some reason gets redirected into https connection to default port ingoring port 8080. But on the computer that runs the server if I visit http://0.0.0.0:8080 it gets served correctly.

Also I tried theese commands to debug if there is any network error (please keep in mind that I run ubuntu linux 16.04 that also serves the ad-hoc wireless network):

On the ad-hoc serving computer I setup a netcat to listen into port 8080

nc -4 -k -l -v 10.42.0.1 8080

Then on another computer connected into the ad-hoc (rasberrypi) wi-fi I run:

nc 10.42.0.1 8080

Then whatever I typed into the promt I could see it into the ad-hoc serving machine therefore is not ad-hoc's fault or firewall closed port.

Furtermore If I run the app through meteor run command then on the rapberrypi's browser when I visit the http://10.42.0.1:3000 url it works just fine.

Do you fellows have an Idea why that happens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions