Index: /trunk/ntripserver/ntripserver.c
===================================================================
--- /trunk/ntripserver/ntripserver.c	(revision 10673)
+++ /trunk/ntripserver/ntripserver.c	(revision 10674)
@@ -495,17 +495,25 @@
   /*** proxy server handling ***/
   if (*proxyhost) {
-    inhost = proxyhost;
-    inport = proxyport;
-    i = snprintf(szSendBuffer, sizeof(szSendBuffer), "http://%s:%d", casterinhost, casterinport);
-    if ((i > SZ) || (i < 0)) {
-      fprintf(stderr,
-          "ERROR: Destination caster name/port to long - length = %d (max: %d)\n",
-          i, SZ);
-      exit(0);
+    // Input
+    if (strstr(casterinhost, "127.0.0.1") ||
+        strstr(casterinhost, "localhost")) {
+      inhost  = casterinhost;
+      outport = casterinport;
     } else {
-      strncpy(get_extension, szSendBuffer, (size_t) i);
-      strcpy(szSendBuffer, "");
-      i = 0;
-    }
+      inhost = proxyhost;
+      inport = proxyport;
+      i = snprintf(szSendBuffer, sizeof(szSendBuffer), "http://%s:%d", casterinhost, casterinport);
+      if ((i > SZ) || (i < 0)) {
+        fprintf(stderr,
+            "ERROR: Destination caster name/port to long - length = %d (max: %d)\n",
+            i, SZ);
+        exit(0);
+      } else {
+        strncpy(get_extension, szSendBuffer, (size_t) i);
+        strcpy(szSendBuffer, "");
+        i = 0;
+      }
+    }
+    // Output
     if (strstr(casterouthost, "127.0.0.1") ||
         strstr(casterouthost, "localhost")) {
