Open Thordax opened 12 months ago
I found a few problems with this issue:
After many investigations, the problem concerned this code:
options.HttpClientFactory = new ProxyAwareHttpClientFactory();
//...
public class ProxyAwareHttpClientFactory : HttpClientFactory
{
protected override HttpMessageHandler CreateHandler(CreateHttpClientArgs args)
{
var httpClientHandler = new HttpClientHandler
{
Proxy = new WebProxy(GlobalSettings.ProxyUrl, GlobalSettings.ProxyPort),
UseProxy = true
};
return httpClientHandler;
}
}
I thought this code would allow Firebase to send messages via the proxy specified in the ProxyAwareHttpClientFactory. However, this is not the case, the proxy is not used. To get around the problem, I specified the proxy in the web.config file, as follows:
In my web.config :
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy
usesystemdefault="true"
proxyaddress="http://myproxy:8080"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>
This allows FCM to send requests correctly via the proxy.
I have a WCF (Windows Communication Foundation) server. Recently, I tried to update the sending of notifications from a basic https request to Firebase Admin SDK.
The code I'm using in console version works perfectly from my machine. On the other hand, the same code used from the WCF on the same machine remains blocked when sending.
Here's the method I use:
The method remains blocked at the following line:
Could you please tell me what could have caused the problem?
Note that I'm using a proxy and that there may also be a firewall on the machine. Are there any specific ports that need to be unblocked?
If so, how can this work from my executable?
Thanks in advance for your help, and have a nice day,
I tried to send a notification through FCM from my WCF.