For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/rspeedy/rspeedy.server.host.md.
Rspeedy logo
Rspeedy
  • 简体中文
  • Home > @lynx-js/rspeedy > Server > host

    Server.host property

    Specify the host that the Rspeedy Server listens to.

    Signature:

    host?: string | undefined;

    Default Value

    "0.0.0.0"

    Remarks

    During rspeedy dev, if server.host is unset, the dev plugin resolves dev-server-related URLs and client host settings with a detected non-loopback IPv4 address, such as 192.168.1.50. It falls back to an eligible IPv6 address, then to an IPv4 loopback address when no non-loopback IP is available. If you have multiple network interfaces, set server.host explicitly to choose the desired address.

    Example

    Set the host to a custom value:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      server: {
        host: "192.168.1.50",
      },
    })
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。