diff --git a/MCAPI.class.php b/MCAPI.class.php
index 6c10502..f07946b 100644
--- a/MCAPI.class.php
+++ b/MCAPI.class.php
@@ -29,16 +29,22 @@ class MCAPI {
      */
     var $secure = false;
     
+    var $proxy_name;
+
+    var $proxy_port;
+
     /**
      * Connect to the MailChimp API for a given list.
      * 
      * @param string $apikey Your MailChimp apikey
      * @param string $secure Whether or not this should use a secure connection
      */
-    function MCAPI($apikey, $secure=false) {
+    function MCAPI($apikey, $secure=false, $proxy_n='', $proxy_p='') {
         $this->secure = $secure;
         $this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
         $this->api_key = $apikey;
+        $this->proxy_name = $proxy_n;
+        $this->proxy_port = $proxy_p;
     }
     function setTimeout($seconds){
         if (is_int($seconds)){
@@ -1957,8 +1963,20 @@ class MCAPI {
         $this->errorCode = "";
         $post_vars = $this->httpBuildQuery($params);
         
-        $payload = "POST " . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . $method . " HTTP/1.0\r\n";
-        $payload .= "Host: " . $host . "\r\n";
+        $if_https = "";
+        $http_host = $host;
+        $fsock_host = "ssl://".$host;
+        $fsock_port = 443;
+
+        if ($this->proxy_name != '') {
+          $if_https = "https://" . $host;
+          $http_host = $this->proxy_name;
+          $fsock_host = $this->proxy_name;
+          $fsock_port = $this->proxy_port;
+        }
+
+        $payload = "POST " . $if_https . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . $method . " HTTP/1.0\r\n";
+        $payload .= "Host: " . $http_host . "\r\n";
         $payload .= "User-Agent: MCAPI/" . $this->version ."\r\n";
         $payload .= "Content-type: application/x-www-form-urlencoded\r\n";
         $payload .= "Content-length: " . strlen($post_vars) . "\r\n";
@@ -1968,7 +1986,7 @@ class MCAPI {
         ob_start();
         if ($this->secure){
             try {
-              $sock = @fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
+              $sock = @fsockopen($fsock_host, $fsock_port, $errno, $errstr, 30);
               if(!$sock){
               throw new Exception('Could not connect to Mailchimp');}
             } catch (Exception $e) {
@@ -1977,7 +1995,7 @@ class MCAPI {
             }
         } else {
             try {
-              $sock = @fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
+              $sock = @fsockopen($fsock_host, $fsock_port, $errno, $errstr, 30);
               if(!$sock){
               throw new Exception('Could not connect to Mailchimp');}
             } catch (Exception $e) {
diff --git a/mailchimp.admin.inc b/mailchimp.admin.inc
index 060fc00..e645694 100644
--- a/mailchimp.admin.inc
+++ b/mailchimp.admin.inc
@@ -22,10 +22,36 @@ function mailchimp_admin_settings() {
       '#description' => t('The API key for your MailChimp account. Get or generate a valid API key at your !apilink.', array('!apilink' => l(t('MailChimp API Dashboard'), 'http://admin.mailchimp.com/account/api')))
   );
   
+  $form['mailchimp_proxy'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Proxy server settings'),
+    '#description' => t('Your installation might need to tunnel all HTTP requests through a proxy server. You can define your proxy parameters below.'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+  
+  $form['mailchimp_proxy']['mailchimp_proxy_name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Name of your PROXY server'),
+    '#description' => t('You can set the name of the proxy server here, e.g. myproxy.com'),
+    '#default_value' => variable_get('mailchimp_proxy_name', FALSE),
+  );
+  
+  $form['mailchimp_proxy']['mailchimp_proxy_port'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Port of your PROXY server'),
+    '#description' => t('You can set the port of the proxy server  here, e.g. 8080'),
+    '#default_value' => variable_get('mailchimp_proxy_port', FALSE),
+  );
+    
+
   // only show the list selection forms if account info provided
   $api_key = variable_get('mailchimp_api_key', FALSE);
+  $proxy_name = variable_get('mailchimp_proxy_name', FALSE);
+  $proxy_port = variable_get('mailchimp_proxy_port', FALSE);
+
   if ($api_key) {
-    $q = new MCAPI($api_key);
+    $q = new MCAPI($api_key, FALSE, $proxy_name, $proxy_port);
 
     if (!$q->errorCode) {
       $lists = $q->lists();
