     }
 
     /**
+     Allows configuring HubConnection options.
+
+     - parameter configureHubConnectionOptions: a callback allowing to configure HubConnectionOptions
+     */
+    public func withHubConnectionOptions(configureHubConnectionOptions: (_ hubConnectionOptions: HubConnectionOptions) -> Void) -> HubConnectionBuilder {
+        configureHubConnectionOptions(hubConnectionOptions)
+        return self
+    }
+
+    /**
      Allows configuring `PrintLogger` logging.
 
      - parameter minLogLevel: minimum log level

    private let url: URL
    private var hubProtocolFactory: (Logger) -> HubProtocol = {logger in JSONHubProtocol(logger: logger)}
    private let httpConnectionOptions = HttpConnectionOptions()
    private var logger: Logger = NullLogger()
    private var delegate: HubConnectionDelegate?
    private var reconnectPolicy: ReconnectPolicy = NoReconnectPolicy()

     */
    public func build() -> HubConnection {
        let httpConnection = createHttpConnection(transportFactory: transportFactory(logger, permittedTransportTypes))
        let hubConnection = HubConnection(connection: httpConnection, hubProtocol: hubProtocolFactory(logger), hubConnectionOptions: hubConnectionOptions, logger: logger)
        hubConnection.delegate = delegate
        return hubConnection
    }
