Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.87k stars 1.85k forks source link

The SDK should use the iOS device system proxy when ran from an iOS Swift Application #2316

Open jujuforce opened 7 months ago

jujuforce commented 7 months ago

Is your feature request related to a problem? Please describe.

The iOS speech SDK does not work when used from my enterprise network, because we need to use a proxy to reach external ressources. It does work no problem when I am not in this network because then the proxy is no longer required. Error log :

2024-03-26 15:39:23.710 cancelled: SPXResultReason(rawValue: 1), Optional("Connection failed (no connection to the remote host). Internal error: 11. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_ERROR\nwss://westeurope.stt.speech.microsoft.com/speech/universal/v2\nX-...

The test device does have the proxy set up and I can fetch it no problem using CFNetworkCopySystemProxySettings() I get the kCFProxyAutoConfigurationURLKey filled, no problem. So I don't understand why the SDK is not using it to reach Microsoft servers.

Describe the solution you'd like The SDK should use the iOS device system proxy when ran from an iOS Swift Application.

Describe alternatives you've considered No idea unfortunately

rhurey commented 7 months ago

Thanks for reaching out.

The way the SDK is architected it doesn't consume the system proxy, but uses its own configuration for proxy control. In particular the Speech Configuration has properties to point to a proxy.

jujuforce commented 7 months ago

Thanks for reaching out.

The way the SDK is architected it doesn't consume the system proxy, but uses its own configuration for proxy control. In particular the Speech Configuration has properties to point to a proxy.

Thanks for answering, however the mechanism is not available on iOS as quoted :

Note: Proxy functionality is not available on iOS and macOS. This function will have no effect on these platforms.

Anyway, there should be an option for the SDK to consume the system proxy or at least not defeating it by design. I fail to understand why this is not the case, especially for enterprise use.

Thanks.

rhurey commented 7 months ago

I am embarrassed I missed that disclaimer.

So I went and reviewed the macOS code base, and sure enough the underlying API the SDK calls into doesn't use the system proxy, nor take a proxy from its callers.

Unfortunately, there isn't another solution available at the moment. However, I will add this issue to our backlog for further consideration.

Thank you for your understanding.

jujuforce commented 7 months ago

No worries @rhurey

Ok I'll keep following this ticket waiting for the good news! In the meantime, our infra guy suggested to try the Azure Private Link feature : https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-services-private-link?tabs=portal#turn-on-private-endpoints

It will not work for all our use-cases, but it could at least help up going a bit further while waiting for the system proxy feature to be i added hopefully. Do you think it could be a good idea?

Thanks.

pankopon commented 6 months ago

Internal work item ref. 1495322. No ETA.

github-actions[bot] commented 5 months ago

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.