@@ -16,6 +16,7 @@ public class HttpHubConnectionBuilder {
16
16
private final String url ;
17
17
private Transport transport ;
18
18
private HttpClient httpClient ;
19
+ private HubProtocol protocol ;
19
20
private boolean skipNegotiate ;
20
21
private Single <String > accessTokenProvider ;
21
22
private long handshakeResponseTimeout = 0 ;
@@ -54,6 +55,17 @@ HttpHubConnectionBuilder withHttpClient(HttpClient httpClient) {
54
55
this .httpClient = httpClient ;
55
56
return this ;
56
57
}
58
+
59
+ /**
60
+ * Sets the {@link HubProtocol} to be used by the {@link HubConnection}.
61
+ *
62
+ * @param protocol The {@link HubProtocol} to be used by the {@link HubConnection}.
63
+ * @return This instance of the HttpHubConnectionBuilder.
64
+ */
65
+ HttpHubConnectionBuilder withProtocol (HubProtocol protocol ) {
66
+ this .protocol = protocol ;
67
+ return this ;
68
+ }
57
69
58
70
/**
59
71
* Indicates to the {@link HubConnection} that it should skip the negotiate process.
@@ -133,7 +145,7 @@ public HttpHubConnectionBuilder setHttpClientBuilderCallback(Action1<OkHttpClien
133
145
* @return A new instance of {@link HubConnection}.
134
146
*/
135
147
public HubConnection build () {
136
- return new HubConnection (url , transport , skipNegotiate , httpClient , accessTokenProvider ,
148
+ return new HubConnection (url , transport , skipNegotiate , httpClient , protocol , accessTokenProvider ,
137
149
handshakeResponseTimeout , headers , transportEnum , configureBuilder );
138
150
}
139
151
}
0 commit comments