Pass proxy down to libsignal Net instance
This commit is contained in:
@@ -169,7 +169,7 @@ export class SocketManager extends EventListener {
|
|||||||
const useLibsignalTransport =
|
const useLibsignalTransport =
|
||||||
window.Signal.RemoteConfig.isEnabled(
|
window.Signal.RemoteConfig.isEnabled(
|
||||||
'desktop.experimentalTransport.enableAuth'
|
'desktop.experimentalTransport.enableAuth'
|
||||||
) && this.#transportOption(proxyAgent) === TransportOption.Libsignal;
|
) && this.#transportOption() === TransportOption.Libsignal;
|
||||||
|
|
||||||
const process = useLibsignalTransport
|
const process = useLibsignalTransport
|
||||||
? connectAuthenticatedLibsignal({
|
? connectAuthenticatedLibsignal({
|
||||||
@@ -580,14 +580,7 @@ export class SocketManager extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#transportOption(proxyAgent: ProxyAgent | undefined): TransportOption {
|
#transportOption(): TransportOption {
|
||||||
const { hostname } = URL.parse(this.options.url);
|
|
||||||
|
|
||||||
// transport experiment doesn't support proxy
|
|
||||||
if (proxyAgent || hostname == null || !hostname.endsWith('signal.org')) {
|
|
||||||
return TransportOption.Original;
|
|
||||||
}
|
|
||||||
|
|
||||||
// in staging, switch to using libsignal transport
|
// in staging, switch to using libsignal transport
|
||||||
if (isStaging(this.options.version)) {
|
if (isStaging(this.options.version)) {
|
||||||
return TransportOption.Libsignal;
|
return TransportOption.Libsignal;
|
||||||
@@ -643,7 +636,7 @@ export class SocketManager extends EventListener {
|
|||||||
|
|
||||||
log.info('SocketManager: connecting unauthenticated socket');
|
log.info('SocketManager: connecting unauthenticated socket');
|
||||||
|
|
||||||
const transportOption = this.#transportOption(proxyAgent);
|
const transportOption = this.#transportOption();
|
||||||
log.info(
|
log.info(
|
||||||
`SocketManager: connecting unauthenticated socket, transport option [${transportOption}]`
|
`SocketManager: connecting unauthenticated socket, transport option [${transportOption}]`
|
||||||
);
|
);
|
||||||
|
@@ -1726,6 +1726,10 @@ export function initialize({
|
|||||||
certificateAuthority
|
certificateAuthority
|
||||||
);
|
);
|
||||||
libsignalNet.setIpv6Enabled(!disableIPv6);
|
libsignalNet.setIpv6Enabled(!disableIPv6);
|
||||||
|
if (proxyUrl) {
|
||||||
|
log.info('Setting libsignal proxy');
|
||||||
|
libsignalNet.setProxyFromUrl(proxyUrl);
|
||||||
|
}
|
||||||
|
|
||||||
// Thanks to function-hoisting, we can put this return statement before all of the
|
// Thanks to function-hoisting, we can put this return statement before all of the
|
||||||
// below function definitions.
|
// below function definitions.
|
||||||
|
Reference in New Issue
Block a user