I am trying to hit a SailsJS app, that is running on my localhost at port 1337
.
I am not sure whether 192.168.99.100
is the correct host, so that the gateway container can talk to the host machine?
This is the .json
file of my gateway configuration:
{
...
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default",
"use_extended_paths": true,
"extended_paths": {
"url_rewrites": [
{
"path": "test/asd",
"method": "GET",
"match_pattern": "test/asd",
"rewrite_to": "test"
}
]
}
}
}
},
"proxy": {
"preserve_host_header": false,
"listen_path": "/test/asd",
"target_url": "http://192.168.99.100:1337/",
"strip_listen_path": false
},
"enable_batch_request_support": false
}
In the logs of the gateway I can see the gateway is hit, but does not redirect:
I believe the problem is in telling the gateway the correct host/IP, but I am not sure how to find that out.
UPDATE:
I ran /sbin/ip route|awk '/default/ { print $3 }'
inside the container to find out the IP that Docker for Mac uses to talk to the host machine is 172.17.0.1
. Now, I replaced that in the .json
file, so now it’s:
"target_url": "http://172.17.0.1:1337/"
But I get http: proxy error: dial tcp 172.17.0.1:1337: getsockopt: connection refused"
error.