Help Center/ Object Storage Service/ SDK Reference/ C/ FAQs/ Invalid Proxy Settings
Updated on 2024-12-03 GMT+08:00

Invalid Proxy Settings

1. When the proxy is configured in a Windows SDK demo, the program reports the following error and the proxy configuration fails.

Root cause: The demo header file eSDKOBS.h of some SDK versions is not synchronously updated with the SDK eSDKOBS.h. As a result, the proxy settings in the option become invalid.

Solution: Replace yourSDKpath\source\eSDK_OBS_API\eSDK_OBS_API_C++\build\obs\demo\eSDKOBS.h with yourSDKpath\source\eSDK_OBS_API\eSDK_OBS_API_C++\inc\eSDKOBS.h.

In addition, modify the demo as follows to adapt to the changes of eSDKOBS.h. (The adaptation of version 3.22.7 is used as an example. The process of other versions may differ.)

In the demo_windows.cpp file under yourSDKpath\source\eSDK_OBS_API\eSDK_OBS_API_C++\build\obs\demo\, add obs_upload_file_server_callback server_callback to line 4749.

In line 4750, add server_callback after the fourth parameter of the upload_file function, as shown in the figure below.

2. If the proxy is configured but the connection still fails, the proxy may not be configured in the get_api_version function of the SDK request.c.

Add the logic of configuring the proxy (the CURLOPT_PROXY and CURLOPT_PROXYUSERPWD items) for the curl in the get_api_version function by referring to the method of configuring the proxy in the setup_curl function of the SDK request.c.