Apiary Proxy Request Timed Out - apiary.io

I'm trying to use Apiary to document my API and test requests but I keep getting a response 504 Proxy Request Timed Out.
My API is running on my machine under http://localhost:3000/ and I specified that under the HOST metadata.
When I click compare under the call, it shows that Apiary added a header "host" that specifies a user specific proxy.
Is there something I am missing or does Apiary just not like localhosts?

Because the proxy remotely calls your specified HOST, you cannot directly call localhost. You could could use https://ngrok.com and set up a tunnel and use the tunnel URL as the HOST.

Related

In Mirth (nextgen-connect) how do I configure the HTTP URL of an HTTP Listener

The manual says this about the HTTP URL value of an http listener:
"Displays the generated HTTP URL for the HTTP Listener. This is not an actual
configurable setting, but is instead displayed for copy/paste convenience. Note
that the host in the URL will be the same as the host you used to connect to
the Administrator. The actual host that connecting clients use may be different
due to differing networking environments."
When I have used the feature in the past its value has always begun "http://localhost:" which would be great except this time it is auto-generating " http://'domainName':${Incoming_Pathology_Source_Port}/${Incoming_Pathology_Source_BaseContextPath}/"
For the first time, we are deploying Mirth inside a Kubernetes cluster, 'a different working environment'. (nginx accepts https and we want it pass the messages on as http to Mirth).
Is there any way I can take control of the URL or must I change the configuration of the cluster in some way.
All help/suggestions welcome.

How to send fetch request from HTTPS to a HTTP server : Mixed Content error

I am using a NextJs app where I am using a simple fetch to send some POST data.
We I used app on localhost it worked fine but when I put it on the server it got following error.
Mixed Content: The page at 'https://speechwithai.com/home' was loaded
over HTTPS, but requested an insecure resource
'http://18.224.190.161:5000/fileToText'. This request has been
blocked; the content must be served over HTTPS.
The from and to are both on same IP address (https://speechwithai.com/). At the back I am running NGINX to server WebAPP at port 80 and Flask REST API at 5000. I am using Flask because I needed python libraries to process some files.
I tried multiple post but I did not find any solution. Could someone please help me?
All I want is to send a request to my FLASK API server which is running
http://someIPAddress:5000 from https://myLiveNextJsApplication.com
Since both servers are running behind same server and you already have nginx setup.
follow these steps
setup reverse proxy for flask
with some thing like below
events {}
http {
server {
listen 443;
location /flask_api {
proxy_pass http://127.0.0.1:5000/;
}
nginx configuration resides in /etc/nginx/nginx.conf
.
For more information visit https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
configure ui to use this flask_api
url = https://speechwithai.com/flask_api
update flask path route to use /flask_api

Custom endpoint path for AWS API Gateway WebSocket

I have created an API Gateway with Websocket protocol.
After I deploy the API, I get a WebSocket URL and a connection URL.
e.g.
WebSocket URL: wss://xxxx.execute-api.us-west-2.amazonaws.com/test
Connection URL: https://xxxx.execute-api.us-west-2.amazonaws.com/test/#connections
Now everything is fine, I am able to connect to the API, and send and receive messages.
But when I try to access a different path, I get an HTTP 403 error.
e.g. If I try to connect to wss://xxxx.execute-api.us-west-2.amazonaws.com/test/some/path
, I get 403 error.
Is it possible to configure API gateway in such a way that it accepts connections to all paths and passes on the path, i.e. /some/path in my case, to the $connect route handler?
This is not yet supported by AWS. See the article and comments here https://medium.com/#lancers/using-parameter-mapping-in-websocket-api-67b414376d5e
There is a workaround with using an additional server, author of the article proposes the following:
you may put your own server that accepts an URI with path parameters, then return 302 to redirect the client to the WebSocket API endpoint with query string instead.

HTTPS Request/Response processing via Apama

What additional setup is required to perform HTTPS call using HTTPClient adapter in Apama. I have used the host and port as 443. But still it is giving host not found error with status 400. The same https endpoint is working in POSTMAN , Browser and Integration Server. Please help.
You need to set 'tls' to true in the config for HTTPClient (see http://www.apamacommunity.com/documents/10.3.1.1/apama_10.3.1.1_webhelp/apama-webhelp/#page/apama-webhelp%2Fco-ConApaAppToExtCom_httpclient_configuring_the_http_client_transport.html%23 )
Or, if you're using the Generic HTTP EPL API, it's HttpTransport.getOrCreateWithConfigurations(host, port, {HttpTransport.CONFIG_TLS:"true"})
There's also tlsAcceptUnrecognizedCertificates and tlsCertificateAuthorityFile if you have a service that's not using a recognisable certificate.

Connecting to localhost redirects through proxy

I am trying to call an endpoint on a locally hosted Tomcat server using Postman. However, when I make the call to:
localhost:9000/api/postMethod
it redirects my request through the corporate proxy.
I don't see any options in Postman and I have tried removing the proxy settings in the internet options, but the problem persists.
When I look at the Postman Console, I see the below. Why is it sending proxy-authorization and proxy-connection to localhost?
Request Headers:
cache-control:"no-cache"
Postman-Token:"{token}"
User-Agent:"PostmanRuntime/3.0.11-hotfix.2"
Accept:"*/*"
accept-encoding:"gzip, deflate"
proxy-authorization:"Basic {auth}"
referer:"http://localhost:9000/api/postMethod"
Response Headers:
cache-control:"no-cache"
connection:"Keep-Alive"
content-length:"8063"
content-type:"text/html; charset=utf-8"
pragma:"no-cache"
proxy-connection:"Keep-Alive"
I had my http_proxy system environment variable set. Looks like it's working once I removed it and restarted Postman.
You must set the following environment variables (I do it in .bashrc file):
$ env | grep PROXY
HTTP_PROXY=myProxy:9999
HTTPS_PROXY=myProxy:9999
NO_PROXY=localhost,127.0.0.1
Then, you have to tell Postman to use the System Proxy in the Proxy settings section. It's just annoying because you can set your proxy in the settings, but you can't set no proxy hosts.
If you're stuck behind a corporate proxy or similar and you're using automatic proxy configuration which won't let you allow to connect to localhost addresses, this is what helped me:
Try using your IP address instead of localhost as a host name in your client application, e.g. http://127.0.0.1/api/v1/...