Arba | 2018-11-14 11:05:46 UTC | #1
I face an environment that has proxy rule to connect to the internet. I need to use Notification API to retrieve some notification topic.
I follow the instruction to use NotificationHandler Helper Class from the SDK Documentation
But cannot find any refference to setup websocket to use proxy. From Websocketsharp Library Documentation (githubdotcom/sta/websocket-sharp) i know that it already support proxy. And seems we just need to use SetProxy method before calling the Connect method var ws = new WebSocket ("ws://example.com"); ws.SetProxy ("http://localhost:3128", "nobita", "password"); ws.Connect()
But, i found that NotificationHandler Helper Class declare the websocket property as private for set method.
/// <summary> /// The WebSocket object used to receive notifications /// </summary> public WebSocket WebSocket { get; private set; }
I've tried it wouldn't work if we do like this : Dim handler = New NotificationHandler() handler.WebSocket.SetProxy("http://192.168.1.100:808", "", "")
Is it by default that NotificationHandler Helper Class not support proxy ?
How is the best way then ? The current workaround that working is modify the PureCloud SDK from github and make the client apps to refer to the build library instead of nuget official release.
Thank you for your support
Regards, Arba
tim.smith | 2018-11-15 16:20:09 UTC | #2
I can add support for that by allowing you to set the proxy when constructing the NotificationHandler class. Does that work for you?
I've created API-3932 for this.
fcatinocluster | 2018-11-28 14:12:04 UTC | #3
Hi, I've done a PR for this:https://github.com/MyPureCloud/platform-client-sdk-dotnet/pull/2
Greetings
tim.smith | 2018-11-28 18:33:27 UTC | #4
Thanks for the submission! However, that repo is only generated code and therefore can't accept PRs. I've declined that PR, but will accept a PR to the generator's source here: https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/resources/sdk/pureclouddotnet/extensions/Extensions/Notifications/NotificationHandler.cs. If you do submit a PR there, please add the ability to specify these parameters in the constructors as well since ConnectSocket(...) is called in the constructors automatically.
system | 2018-12-29 18:33:29 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 3980