question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add --host option

See original GitHub issue

Is your feature request related to a problem? Please describe. I’d like to expose my dev server to other machines, so wish to bind to 0.0.0.0 and not localhost.

Describe the solution you’d like Add a --host option (along side existing --port option).

Describe alternatives you’ve considered Port forwarding is butchered on WSL; don’t want to deal with it now.

How important is this feature to you? Somewhat.

Additional context

node_modules/.bin/svelte-kit dev --help

  Description
    Start a development server

  Usage
    $ svelte-kit dev [options]

  Options
    -p, --port    Port  (default 3000)
    -o, --open    Open a browser tab  (default false)
    -h, --help    Displays this message

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bjoncommented, Mar 26, 2021

I think svelte-kit dev --host fake.domain.com --open should replace http://localhost:3000 with http://fake.domain.com:3000.

Its good to have, when developing with third-party libs, that require a “real” host.

1reaction
johnyvelhocommented, Mar 30, 2021

you can get it bound on 0.0.0.0 by editing svelte.config.cjs and configuring vite, like so:

// svelte.config.cjs

module.exports = {
  kit: {
    vite: {
      server: {
        host: '0.0.0.0'
      }
    }
  }
}

All available options are documented here https://vitejs.dev/config/#server-host

@srid Can you confirm this helps you achieve your goal?

I tried it and didn’t help 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Add-Host Flag for DNS Mapping within Docker ...
The --add-host flag is used to add a single host to IP mapping within a Docker container. This flag can be useful when...
Read more >
Enabling and adding a co-host - Zoom Support
Under In Meeting (Basic), verify that the Co-host setting is enabled. If the setting is disabled, click the toggle to enable it.
Read more >
Docker run reference
With the docker run [OPTIONS] an operator can add to or override the image defaults set ... The host setting will result in...
Read more >
Adding static entry for hosts that are not resolving by DNS on ...
Go to Start > run Notepad. · Right click on the Notepad icon and select Run as a administrator. · Select Open from...
Read more >
--add-host=host:ip — Podman documentation
Add a line to /etc/hosts. The format is hostname:ip. The --add-host option can be set multiple times. Conflicts with the --no-hosts option.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found