# Hub Method

## Overloads

| [Hub(ILocation, ISession)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.Hub.htm#Qlik_Engine_LocationExtensions_Hub_Qlik_Engine_ILocation_Qlik_Engine_ISession_) |  | Connect to the Qlik Sense hub.<br>This method opens a websocket connection. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.Hub.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.Hub.htm)

## Hub(ILocation, ISession)

Connect to the Qlik Sense hub. This method opens a websocket connection.

### Declaration

```

          public static IHub Hub(this ILocation location, ISession session = null)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [ILocation](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ILocation.htm) | location | Location object of the Qlik Sense instance |
| [ISession](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | session | Defines a specific app session, that can be connected to. |

### Returns

| Type | Description |
| --- | --- |
| [IHub](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IHub.htm) | IHub |