-
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
42 changed files
with
990 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ bin/ | |
.project | ||
|
||
local.properties | ||
|
||
lombok.config |
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
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
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
37 changes: 37 additions & 0 deletions
37
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,37 @@ | ||
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.Arrays; | ||
|
||
public class ClientOptionsUtils { | ||
|
||
public static ProxyConfig convertToProxyConfig(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); | ||
|
||
if (clientOptions.proxy.nonProxyHosts != null) { | ||
builder.nonProxyHosts(Arrays.asList(clientOptions.proxy.nonProxyHosts)); | ||
} | ||
|
||
switch (clientOptions.proxy.prefAuthType) { | ||
case BASIC: | ||
builder.authType(ProxyAuthType.BASIC); | ||
break; | ||
case DIGEST: | ||
builder.authType(ProxyAuthType.DIGEST); | ||
break; | ||
} | ||
|
||
return builder.build(); | ||
} | ||
} |
Oops, something went wrong.