How to set a proxy to `g_file_copy()`

Is there a way to set a http proxy to g_file_copy(src, dst, ...), where:

src = g_file_new_for_uri("http://...");
dst = g_file_new_for_uri("file:///...");


I only want this g_file_copy() to use specified proxy so the global setting isn’t applicable IIUC.

GSocketClient has a property PROP_PROXY_RESOLVER, but it seems to me that gsocketinputstream.h isn’t public.

1 Like

I don’t think it’s possible using g_file_copy(). The HTTP implementation for g_file_copy() lives in gvfs and the code for the HTTP backend, and it doesn’t have any specific proxy handling.

I think your best bet is to use libsoup directly to download the file and set the proxy as you wish.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.