Using local proxy server for external requests from corporate network

I have tyk api gateway running on my local machine. I also have a proxy server running on my machine on port 3128 that allows internet access from my machine. I’ve tried below but that returns 500.

"proxy": {
      "listen_path": "/fhir-api/",
      "strip_listen_path": true,
      "target_url": "http://httpbin.org/post",
        "transport": {
          "proxy_url": "http://127.0.0.1:3128",
          "ssl_insecure_skip_verify": true,
          "ssl_force_common_name_check": false
      }
    }

I can directly access from Postman as I have specified the proxy server in Postman settings. But I need to make that request from Tyk.

Alternately, how can I send the response (json or anything) directly from Tyk (app or middleware) without using httpbin? I understand that I need to specify where to send the response but can I do that without creating another application or using something like httpbin? This is basically to show users given a request they get correct response. At this stage the consuming application/api is still being discussed. I have a middleware that transforms data.

Hi @tej-rana,

I believe 127.0.0.1 (localhost) within a cluster (kubernetes…docker…) differs from that of the Host machine. See these? [1] [2]

You can send a response directly from tyk using a mock response.
See part of API def.

"extended_paths": {
            "white_list": [
              {
                "disabled": false,
                "path": "mock",
                "method": "",
                "ignore_case": false,
                "method_actions": {
                  "GET": {
                    "action": "reply",
                    "code": 200,
                    "data": "{\n\"Response\": \"Response from Tyk\"\n}",
                    "headers": {
                      "Content-Type": "application/json"
                    }
                  }
                }
              }
            ]
          }