How is one supposed to configure proxy settings when developing an application using the Meeting SDK for Linux?
I’ve been using the Linux SDK for a couple of weeks to try and setup a demonstration app for a client. In it, the application will perform SDK authentication and join a meeting. This works with no problem the way it is written. The program is similar to the following:
//Error handling and event classes omitted for brevity.
using namespace ZOOMSDK;
int main(int argc, char**argv) {
InitParam initParam;
initParam.strWebDomain = "https://zoom.us";
initParam.strSupportUrl = "https://zoom.us";
initParam.emLanguageID = LANGUAGE_English;
initParam.enableLogByDefault = true;
SDKError result = InitSDK(initParam);
IMeetingService *mtgSvc; // Assume initialized with CreateMeetingService(...)
IAuthService *authSvc; // Assume initialized with CreateAuthService(...)
authSvc->SetEvent(&myAuthServiceEvent); // Responds to SDKAuth by joining a meeting
AuthContext authContext;
authContext.jwt_token = jwtToken; //Assume set with valid JWT
authSvc->SDKAuth(authContext);
/* Create a new GMainLoop with default context (NULL) and initial
state of "not running" (FALSE). */
GMainLoop *mainloop = g_main_loop_new(NULL, FALSE);
/* Failure to create the main loop is fatal (for us). */
if(mainloop == NULL)
{
g_printerr("Failed to create the mainloop Unknown (OOM?)\n");
return EXIT_FAILURE;
}
g_print("Entering run loop\n");
/* Run the program. */
g_main_loop_run(mainloop);
}
The problem occurs when I try to get the SDK to communicate over a proxy. To support this I assume that I have to register a network connection handler, like so:
/*
MyNetworkConnectionHandler is a subclass if INetworkConnectionHandler that will authenticate the SDK once the `onProxyDetectComplete` is called on it.
*/
MyNetConnectionHandler *myNetConnHandler; //Assume initialized and valid.
INetworkConnectionHelper *netConnHelper; //Assume initialized with CreateNetworkConnectionHelper(...)
netConnHelper->RegisterNetworkConnectionHandler(&myNetConnHandler);
The problem I’m having is that it doesn’t seem to do anything. I figured it might respond to environment variable settings. I’ve tried setting the following envvars to http://<ip address>:<port>:
http_proxy
https_proxy
HTTPS_PROXY
HTTP_PROXY
I have also tried configuring the proxy settings directly through the INeworkConnectionHelper like this.
ProxySettings settings;
settings.proxy = "<ip address>:<port>";
settings.auto_detect = true; # or false, doesn't seem to change matters
netConnHelper->ConfigureProxy(settings);
In every case, the application doesn’t seem to do anything once I enter the run loop and I’m not sure what’s going on. I do have some questions:
What is the preferred way of parking the main thread to allow for background (or asynchronous) tasks to complete? Up until now I’ve been using GMainLoop (from glib-2.0) to enter a run loop.
What steps are required before using the INetworkConnectionHelper interface? Is it just InitSDK(...) or are there other SDK services that need to be created/configured beforehand?
Logs would be a huge help when debugging. Is there a way to decrypt these on our own?
I know that for the Meeting SDK, initialization and all API calls must run in the Main Thread. Let me check if there is a way to pause the thread to allow background tasks to be completed. In the meantime, could you provide more information about the background tasks and the type of user experience you are aiming for?
I will follow up with more details on this once the requested information above is provided.
Currently, there is no method available to decrypt SDK logs. To proceed, you will need to enable the logs and share them with us. Please refer to our documentation on how to enable the logs.
The background tasks I was referring to would be any tasks that the Zoom SDK might be completing on behalf of my code. I should have said asynchronous and not background. I assumed that the SDK must be performing certain tasks off of the main thread. At this time, my example code doesn’t perform any of it’s own background tasks. User experience is not a concern at this time. I’m only trying to work out how to utilize the SDK to join a meeting. Currently I’m stuck getting the SDK to account for proxy settings.
I will not be sending any file generated internally to an outside party if I cannot inspect its contents. I’m sure you understand the security implications from the outside and will reconsider why these logs are being encrypted in the first place.
I see that you’re calling the SDKAuth method without waiting for the onProxyDetectComplete callback to be invoked. Does this matter? I’d assumed that one would want to wait for proxy detection to complete and perform SDK authentication in response to it.
I also see that you’re creating the INetworkConntectionHelper before creating the IAuthService. Does the order in which these objects are created matter?
In my example, if I call SDKAuth like this, onAuthenticationReturn(AuthResult ret) is called, but the value of ret is AUTHRET_OVERTIME. Which I’ve taken to mean that the sdk authentication request to the server has timed out. It suggests that the proxy settings were not being utilized.
So far, I’ve only tried setting the http proxy through the environment variables HTTP_PROXY and HTTPS_PROXY (and the lowercase variants of these) or by calling network_connection_helper->ConfigureProxy(). Are you setting your proxy settings in a similar manner? If not, how are you setting them?
I see that you’re calling the SDKAuth method without waiting for the onProxyDetectComplete callback to be invoked. Does this matter? I’d assumed that one would want to wait for proxy detection to complete and perform SDK authentication in response to it.
This is a logic error, you might want to ignore that in the sample code.
I also see that you’re creating the INetworkConntectionHelper before creating the IAuthService . Does the order in which these objects are created matter?
No
So far, I’ve only tried setting the http proxy through the environment variables HTTP_PROXY and HTTPS_PROXY (and the lowercase variants of these) or by calling network_connection_helper->ConfigureProxy() . Are you setting your proxy settings in a similar manner? If not, how are you setting them?