-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: decouple HTTP and WebSocket engines
- Extracted HTTP calls and WebSocket listeners into a separate module. - Introduced an abstraction layer for easier implementation swapping.
- Loading branch information
Showing
39 changed files
with
972 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
lib/src/main/java/io/ably/lib/util/ClientOptionsUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.ably.lib.util; | ||
|
||
import io.ably.lib.network.ProxyAuthType; | ||
import io.ably.lib.network.ProxyConfig; | ||
import io.ably.lib.types.ClientOptions; | ||
|
||
import java.util.List; | ||
|
||
public class ClientOptionsUtils { | ||
|
||
public static ProxyConfig covertToProxyConfig(ClientOptions clientOptions) { | ||
if (clientOptions.proxy == null) return null; | ||
|
||
ProxyConfig.ProxyConfigBuilder builder = ProxyConfig.builder(); | ||
|
||
builder | ||
.host(clientOptions.proxy.host) | ||
.port(clientOptions.proxy.port) | ||
.username(clientOptions.proxy.username) | ||
.password(clientOptions.proxy.password) | ||
.nonProxyHosts(List.of(clientOptions.proxy.nonProxyHosts)); | ||
|
||
switch (clientOptions.proxy.prefAuthType) { | ||
case BASIC: | ||
builder.authType(ProxyAuthType.BASIC); | ||
break; | ||
case DIGEST: | ||
builder.authType(ProxyAuthType.DIGEST); | ||
break; | ||
} | ||
|
||
return builder.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.