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.

Allow user to control bound IP addresses

See original GitHub issue

Is your feature request related to a problem? Please describe. By default, vite binds to all network interfaces on startup and seems to have no obvious override

Describe the solution you’d like Ideally the user should have control over the bound network interfaces to reduce the attack surface as appropriate. I initially expected the server to bind to localhost by default and/or to have an optional host config setting which when set to 0.0.0.0 would bind all network interfaces.

Additional context As a quick proof of concept I hacked together a fix that allows me to achieve the desired result. I doubt this is appropriate given the switch in default behavior and the confusion it would introduce with host versus hostname but it functions as I’d hope and is shared for reference.

https://github.com/vitejs/vite/compare/master...jlewin:master

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
jlewincommented, Mar 30, 2021

A little late to reply but this looks to work now as desired, where the listening IP can be controlled by the user and limited to localhost only.

Thanks!

for reference

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '127.0.0.1'
  }
})
1reaction
underfincommented, Jul 10, 2020

I think it is unnecessary, your code just control ouput which has host or not in terminal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use IAM Roles to restrict API calls from specific IP addresses
I want to restrict access to AWS API calls to specific IP addresses. ... This IAM policy allows the IAM user to AssumeRole...
Read more >
Access Control Policies in AD FS in Windows Server 2012 R2
This client access policy scenario allows access from all internal clients and blocks all external clients based on the IP address of the ......
Read more >
IP Address Access Control
Apply an IP access control to outbound traffic, inbound traffic, or bidirectional traffic. The system only blocks an IP address if a matching ......
Read more >
MySQL: Allow access from specific IP address - LinuxConfig.org
In this tutorial, we show the step by step instructions to allow remote connections to a MySQL server from a specific IP address...
Read more >
Map IP Addresses to Users - Palo Alto Networks
User -ID provides many different methods for mapping IP addresses to usernames. Before you begin configuring user mapping, consider where your ...
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