# Interface SocketIoOptions

Options References: https://github.com/socketio/socket.io-client/blob/master/docs/API.md#new-managerurl-options

interface SocketIoOptions {
autoConnect?: boolean;
enablesXDR?: boolean;
extraHeaders?: {
[header: string]: string;
};
forceBase64?: boolean;
forceJSONP?: boolean;
jsonp?: boolean;
onlyBinaryUpgrades?: boolean;
parser?: any;
path?: string;
policyPort?: number;
protocols?: any;
query?: {
[key: string]: string | null;
};
randomizationFactor?: number;
reconnection?: boolean;
reconnectionAttempts?: number;
reconnectionDelay?: number;
reconnectionDelayMax?: number;
rememberUpgrade?: boolean;
requestTimeout?: number;
timeout?: number;
timestampParam?: string;
timestampRequests?: boolean;
transportOptions?: any;
transports?: string[];
upgrade?: boolean;
}

- Defined in lib/socket-io.config.ts:7

#####
Index

### Properties

autoConnect?
enablesXDR?
extraHeaders?
forceBase64?
forceJSONP?
jsonp?
onlyBinaryUpgrades?
parser?
path?
policyPort?
protocols?
query?
randomizationFactor?
reconnection?
reconnectionAttempts?
reconnectionDelay?
reconnectionDelayMax?
rememberUpgrade?
requestTimeout?
timeout?
timestampParam?
timestampRequests?
transportOptions?
transports?
upgrade?

## Properties

### `Optional` autoConnect

autoConnect?: boolean

By setting this false, you have to call manager.open whenever you decide it's appropriate. Default: true

- Defined in lib/socket-io.config.ts:41

### `Optional` enablesXDR

enablesXDR?: boolean

Enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to false because XDomainRequest has a flaw of not sending cookie. Default: false

- Defined in lib/socket-io.config.ts:74

### `Optional` extraHeaders

extraHeaders?: {
[header: string]: string;
}

Additional headers (then found in socket.handshake.headers object on the server-side). Default value: -

#### Type declaration

- ##### [header: string]: string

- Defined in lib/socket-io.config.ts:114

### `Optional` forceBase64

forceBase64?: boolean

Forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary. Default: false

- Defined in lib/socket-io.config.ts:70

### `Optional` forceJSONP

forceJSONP?: boolean

Forces JSONP for polling transport. Default: false

- Defined in lib/socket-io.config.ts:62

### `Optional` jsonp

jsonp?: boolean

Determines whether to use JSONP when necessary for polling. If disabled (by settings to false) an error will be emitted (saying “No transports available”) if no other transports are available. If another transport is available for opening a connection (e.g. WebSocket) that transport will be used instead. Default: false

- Defined in lib/socket-io.config.ts:66

### `Optional` onlyBinaryUpgrades

onlyBinaryUpgrades?: boolean

Whether transport upgrades should be restricted to transports supporting binary data. Default: false

- Defined in lib/socket-io.config.ts:102

### `Optional` parser

parser?: any

The parser to use. Defaults to an instance of the Parser that ships with Socket.IO Reference: https://github.com/socketio/socket.io-parser

- Defined in lib/socket-io.config.ts:52

### `Optional` path

path?: string

Name of the path that is captured on the server side. Default: /socket.io

- Defined in lib/socket-io.config.ts:11

### `Optional` policyPort

policyPort?: number

Port the policy server listens on. Default: 843

- Defined in lib/socket-io.config.ts:86

### `Optional` protocols

protocols?: any

A list of subprotocols. See https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols

- Defined in lib/socket-io.config.ts:110

### `Optional` query

query?: {
[key: string]: string | null;
}

Additional query parameters that are sent when connecting a namespace (then found in socket.handshake.query object on the server-side)

#### Type declaration

- ##### [key: string]: string | null

- Defined in lib/socket-io.config.ts:45

### `Optional` randomizationFactor

randomizationFactor?: number

Randomization factor for the reconnection delay. Default: 0.5

- Defined in lib/socket-io.config.ts:33

### `Optional` reconnection

reconnection?: boolean

Whether to reconnect automatically. Default: true

- Defined in lib/socket-io.config.ts:15

### `Optional` reconnectionAttempts

reconnectionAttempts?: number

Number of reconnection attempts before giving up. Default: infinity

- Defined in lib/socket-io.config.ts:19

### `Optional` reconnectionDelay

reconnectionDelay?: number

How long to initially wait before attempting a new reconnection. Default: 1000 +- randomizationFactor

- Defined in lib/socket-io.config.ts:24

### `Optional` reconnectionDelayMax

reconnectionDelayMax?: number

Maximum amount of time to wait between reconnections. Default: 5000

- Defined in lib/socket-io.config.ts:29

### `Optional` rememberUpgrade

rememberUpgrade?: boolean

If true and if the previous websocket connection to the server succeeded, the connection attempt will bypass the normal upgrade process and will initially try websocket. A connection attempt following a transport error will use the normal upgrade process. It is recommended you turn this on only when using SSL/TLS connections, or if you know that your network does not block websockets. Default: false.

- Defined in lib/socket-io.config.ts:98

### `Optional` requestTimeout

requestTimeout?: number

Timeout for xhr-polling requests in milliseconds (0) (only for polling transport). Default: 0

- Defined in lib/socket-io.config.ts:106

### `Optional` timeout

timeout?: number

Connection timeout before a connect_error and connect_timeout events are emitted. Default: 20000

- Defined in lib/socket-io.config.ts:37

### `Optional` timestampParam

timestampParam?: string

The timestamp parameter

- Defined in lib/socket-io.config.ts:82

### `Optional` timestampRequests

timestampRequests?: boolean

Whether to add the timestamp with each transport request. Note: polling requests are always stamped unless this option is explicitly set to false.

- Defined in lib/socket-io.config.ts:78

### `Optional` transportOptions

transportOptions?: any

Hash of options, indexed by transport name, overriding the common options for the given transport. Default: {}

- Defined in lib/socket-io.config.ts:94

### `Optional` transports

transports?: string[]

A list of transports to try (in order). Engine always attempts to connect directly with the first one, provided the feature detection test for it passes. Default: ["polling", "websocket"]

- Defined in lib/socket-io.config.ts:90

### `Optional` upgrade

upgrade?: boolean

Whether the client should try to upgrade the transport from long-polling to something better. Default: true

- Defined in lib/socket-io.config.ts:58