---
title: client
configName: dev.client
---

# dev.client

- **Type:**

```ts
type Client = {
  // The protocol name for the WebSocket request
  protocol?: 'ws' | 'wss';
  // The path for the WebSocket request
  path?: string;
  // The port number for the WebSocket request
  port?: string | number;
  // The host for the WebSocket request
  host?: string;
  // The maximum number of reconnection attempts after a WebSocket request is disconnected.
  reconnect?: number;
  // Whether to display an error overlay in the browser when a compilation error occurs
  overlay?: boolean;
};
```

- **Default:**

```js
const defaultConfig = {
  path: '/webpack-hmr',
  port: '<port>',
  // By default it is set to "location.hostname"
  host: '',
  // By default it is set to "location.protocol === 'https:' ? 'wss' : 'ws'""
  protocol: undefined,
  reconnect: 100,
  overlay: false,
};
```

Configure the client code injected by Modern.js during the development process. This can be used to set the WebSocket URL for HMR.

import RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';

<RsbuildConig />
