From 79844540a83d7acaf8166b3081913f1968ebf78c Mon Sep 17 00:00:00 2001 From: blmpl Date: Sat, 15 Oct 2016 10:10:52 +0200 Subject: Support binding to a specific network interface Closes #597. --- src/ui.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 5350dea..69bf9ee 100644 --- a/src/ui.c +++ b/src/ui.c @@ -209,6 +209,15 @@ static CURLcode BarPianoHttpRequest (CURL * const http, setAndCheck (CURLOPT_CAINFO, settings->caBundle); } + if (settings->bindTo!= NULL) { + if (curl_easy_setopt (http, CURLOPT_INTERFACE, + settings->bindTo) != CURLE_OK) { + /* if binding fails, notice about that */ + BarUiMsg (settings, MSG_ERR, "bindTo (%s) is invalid!\n", + settings->bindTo); + } + } + /* set up proxy (control proxy for non-us citizen or global proxy for poor * firewalled fellows) */ if (settings->controlProxy != NULL) { -- cgit v1.2.3