lazarv / react-server

The easiest way to build React apps with server-side rendering
https://react-server.dev
MIT License
121 stars 6 forks source link

Support IPv6 address in server configuration #28

Closed CharidimosTzedakis closed 2 months ago

CharidimosTzedakis commented 2 months ago

Describe the bug

I try to spin up a react-server with IPv6 localhost address: react-server ./src/remote.tsx --name remote --host ::1 --port 3001

I get the following error: Invalid URL Screenshot_20240912_004915

I guess it might not be very common, but the IPv6 urls could be supported when the url is created:

Possibly also in this point as well: https://github.com/lazarv/react-server/blob/main/packages/react-server/lib/start/create-server.mjs#L97

Solution could be something like:

 const hostname = isIPv6(listenerHost) ? `[${listenerHost}]` : listenerHost;

Reproduction

No response

Steps to reproduce

Run react-server ./src/remote.tsx --name remote --host ::1 --port 3001

System Info

System:
    OS: Linux 6.10 EndeavourOS
    CPU: (16) x64 AMD Ryzen 7 5800X3D 8-Core Processor
    Memory: 3.95 GB / 15.54 GB
    Container: Yes
    Shell: 5.2.32 - /bin/bash
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 8.6.9 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @lazarv/react-server: workspace:^ => 0.0.0

Used Package Manager

pnpm

Logs

No response

Validations

lazarv commented 2 months ago

@CharidimosTzedakis you should be able to use IPv6 hostnames in both dev / production servers using the latest version, so please upgrade the @lazarv/react-server package. Thanks for reporting!

github-actions[bot] commented 1 month ago

This issue has been locked since it has been closed for more than 30 days.

If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest version of @lazarv/react-server. If you have any other comments you should create a new discussion.