Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Asset Server always binds to en0, even if it is not the "default" network interface. #1082

Open
lastobelus opened this issue Jan 3, 2020 · 0 comments

Comments

@lastobelus
Copy link

lastobelus commented Jan 3, 2020

Problem

The asset server always binds to the lowest numbered interface, even if it is not the default interface (i.e., the top interface in OS X Network preference pane). The ssl-check script, however, will create certs for the default interface. This will cause styles and js to be broken during local development.

Replication steps

  • plugin to a second ethernet interface (e.g. dock your laptop to a dock with wired ethernet)
  • run yarn start.
  • no styles / js

More Information

I poked around with node-ip to see if there was a way to properly detect the ethernet interface set to default rather than the lowest one, but I did not find one (although you can ask for the address of a particular interface)

Instead I was able to workaround by changing the ssl-check script to add the ip addresses from all interfaces from en0 to en10 (this might be a security issue if one of those interfaces has external access):

interfaces=($(seq 0 1 10))
domains=(
    "localhost"
)

for interface in ${interfaces[@]}; do
    local_ip=$(ipconfig getifaddr en$interface)
    domains+=( $local_ip )
done
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant