diff --git a/packages/redux-devtools-remote/README.md b/packages/redux-devtools-remote/README.md index 586df172..3a32e6aa 100644 --- a/packages/redux-devtools-remote/README.md +++ b/packages/redux-devtools-remote/README.md @@ -137,9 +137,9 @@ For React Native you can use [remotedev-rn-debugger](https://github.com/jhen0409 | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | _String_ representing the instance name to be shown on the remote monitor. | | `realtime` | _Boolean_ specifies whether to allow remote monitoring. By default is `process.env.NODE_ENV === 'development'`. | -| `hostname` | _String_ used to specify host for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). If `port` is specified, default value is `localhost`. | -| `port` | _Number_ used to specify host's port for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). | -| `secure` | _Boolean_ specifies whether to use `https` protocol for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). | +| `hostname` | _String_ used to specify host for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). The default value is `localhost`. | +| `port` | _Number_ used to specify host's port for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). The default value is `8000`. | +| `secure` | _Boolean_ specifies whether to use `https` protocol for [@redux-devtools/cli](https://github.com/reduxjs/redux-devtools/tree/main/packages/redux-devtools-cli). The default value is `false`. | | `maxAge` | _Number_ of maximum allowed actions to be stored on the history tree, the oldest actions are removed once maxAge is reached. Default is `30`. | | `actionsDenylist` | _array_ of actions to be hidden in DevTools. Overwrites corresponding global setting in the options page. See the example bellow. | | `actionsAllowlist` | _array_ of actions to be shown. All other actions will be hidden in DevTools. | diff --git a/packages/redux-devtools-remote/src/devTools.ts b/packages/redux-devtools-remote/src/devTools.ts index 6f517df1..5cfc1a3b 100644 --- a/packages/redux-devtools-remote/src/devTools.ts +++ b/packages/redux-devtools-remote/src/devTools.ts @@ -357,13 +357,12 @@ class DevToolsEnhancer> { whitelist ?? options.actionsWhitelist, }); - if (options.port) { - this.socketOptions = { - port: options.port, - hostname: options.hostname || 'localhost', - secure: options.secure, - }; - } else this.socketOptions = defaultSocketOptions; + this.socketOptions = { + ...defaultSocketOptions, + secure: options.secure ?? defaultSocketOptions.secure, + hostname: options.hostname ?? defaultSocketOptions.hostname, + port: options.port ?? defaultSocketOptions.port, + }; this.suppressConnectErrors = options.suppressConnectErrors !== undefined