mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: ability to send headers via ws connection to browser in node.js environment (#9314)
**What kind of change does this PR introduce?** I have browsers pool in some cloud. I want that only users with access will be able to connect to them. So they must provide token through headers. But puppeteer does not allow to send headers when connected to browser by ws connection. So I added this feature. Closes #7218
This commit is contained in:
committed by
GitHub
parent
da92055e9c
commit
937fffaedc
19
docs/api/puppeteer.connectoptions.headers.md
Normal file
19
docs/api/puppeteer.connectoptions.headers.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
sidebar_label: ConnectOptions.headers
|
||||
---
|
||||
|
||||
# ConnectOptions.headers property
|
||||
|
||||
Headers to use for the web socket connection.
|
||||
|
||||
#### Signature:
|
||||
|
||||
```typescript
|
||||
interface ConnectOptions {
|
||||
headers?: Record<string, string>;
|
||||
}
|
||||
```
|
||||
|
||||
## Remarks
|
||||
|
||||
Only works in the Node.js environment.
|
||||
@@ -14,8 +14,9 @@ export interface ConnectOptions extends BrowserConnectOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------------------------------------------------------------- | --------- | --------------------------------------------------------- | ----------------- | ------- |
|
||||
| [browserURL?](./puppeteer.connectoptions.browserurl.md) | | string | <i>(Optional)</i> | |
|
||||
| [browserWSEndpoint?](./puppeteer.connectoptions.browserwsendpoint.md) | | string | <i>(Optional)</i> | |
|
||||
| [transport?](./puppeteer.connectoptions.transport.md) | | [ConnectionTransport](./puppeteer.connectiontransport.md) | <i>(Optional)</i> | |
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------------------------------------------------------------- | --------- | --------------------------------------------------------- | --------------------------------------------------------------- | ------- |
|
||||
| [browserURL?](./puppeteer.connectoptions.browserurl.md) | | string | <i>(Optional)</i> | |
|
||||
| [browserWSEndpoint?](./puppeteer.connectoptions.browserwsendpoint.md) | | string | <i>(Optional)</i> | |
|
||||
| [headers?](./puppeteer.connectoptions.headers.md) | | Record<string, string> | <i>(Optional)</i> Headers to use for the web socket connection. | |
|
||||
| [transport?](./puppeteer.connectoptions.transport.md) | | [ConnectionTransport](./puppeteer.connectiontransport.md) | <i>(Optional)</i> | |
|
||||
|
||||
Reference in New Issue
Block a user