You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
X-link: facebook/react-native#55701
Pull Request resolved: #1657
Changelog: [Feature] `config.server.tls` now sets Metro to be exposed as an https server
Reviewed By: robhogan, huntie
Differential Revision: D93857257
fbshipit-source-id: 56ff661c4ddf9cd5d4bb32756b9cb600bb032a1c
Copy file name to clipboardExpand all lines: docs/Configuration.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -657,6 +657,25 @@ Type: `boolean`
657
657
658
658
Enable forwarding of`client_log`events (when client logs are [configured](https://github.com/facebook/metro/blob/614ad14a85b22958129ee94e04376b096f03ccb1/packages/metro/src/lib/createWebsocketServer.js#L20)) to the reporter. Defaults to `true`.
659
659
660
+
#### `tls`
661
+
662
+
Type:`false | object`
663
+
664
+
If not provided or is `false` Metro will start an HTTP server withWSWebSocket endpoints.
665
+
666
+
If an object, Metro will start an HTTPS server withWSSWebSocket endpoints using the passed TLS options:
667
+
668
+
```ts
669
+
ca?: string | Buffer, // Certificate authority (contents, not path)
670
+
cert?: string | Buffer, // Server certificate (contents, not path)
671
+
key?: string | Buffer, // Private key (contents, not path)
672
+
requestCert?: boolean, // Whether to authenticate the remote peer by requesting a certificate
673
+
```
674
+
675
+
Notice that when overriding the base config, object tls configs extend the base tls config, false overrides the base tls configs, and `null` and `undefined` are ignored.
676
+
677
+
When running Metro with`Metro.runServer`with the `secureServerOptions` property Metro will likewise start an HTTPS server merging with the `config.server.tls` object if provided, overriding it.
0 commit comments