Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): improve Windows compatibility for Vite dev server #1760

Merged
merged 3 commits into from
Jan 3, 2025

Conversation

gmh5225
Copy link
Contributor

@gmh5225 gmh5225 commented Jan 3, 2025

Localhost Handling: Windows vs macOS

Windows Behavior

  1. Network Stack
  • Defaults to IPv6 (::1) when resolving localhost
  • More strict separation between localhost and IP address bindings
  • Requires explicit permissions for network interface bindings
  • More complex security model with Windows Firewall
  1. Access Control
  • Stricter access control policies
  • Requires explicit configuration to allow applications to bind to all interfaces
  • May require administrator privileges for certain network operations
  • Different handling for IPv4 and IPv6 connections
  1. Common Issues
  • EACCES errors when binding to ports
  • Permission problems with localhost access
  • IPv4/IPv6 conflicts in network applications
  • Needs explicit host configuration in development servers

macOS Behavior

  1. Network Stack
  • Unified handling of localhost resolution
  • Seamless integration between IPv4 and IPv6
  • More permissive default network interface bindings
  • Simplified security model
  1. Access Control
  • More lenient default permissions
  • Automatic handling of localhost-to-IP routing
  • Better integration between different network interfaces
  • Less restrictive port binding policies
  1. Advantages
  • "It just works" approach to localhost
  • Better default security without sacrificing developer experience
  • More consistent behavior across different network configurations
  • Less configuration needed for development environments

Development Impact

This is why development servers like Vite require different configurations:

  • Windows needs host: true to allow IP access
  • macOS works without special configuration
  • Windows often needs explicit IP addresses (127.0.0.1)
  • macOS handles localhost resolution more intelligently

- Add host configuration to allow IP access
- Use explicit IP address instead of localhost
- Support dynamic server port from environment variables
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gmh5225! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

@gmh5225 gmh5225 changed the base branch from main to develop January 3, 2025 14:24
@shakkernerd shakkernerd merged commit 5117c7a into elizaOS:develop Jan 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants