curl -X 'POST' \
'https://myURL/sendImage' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"args": {
"to": "[email protected]",
"file": "DataURL:[GET]https://file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg",
"filename": "yaaay",
"caption": "Hello World!"
}
}'
{
"success": false,
"error": {
"name": "Error",
"message": "connect ECONNREFUSED 127.0.0.1:80"
}
}
connection: keep-alive
content-length: 88
content-type: application/json; charset=utf-8
date: Mon,20 Dec 2021 19:51:47 GMT
etag: W/"58-WctcJ3IEkCT+vkWDIsisJukzaYg"
server: Cowboy
via: 1.1 vegur
x-powered-by: Express
2021-12-20T19:51:02.844941+00:00 heroku[router]: at=info method=POST path="/sendImage" host=MyApp request_id=05669ed1-500f-41b2-a73b-ec5c009e0157 fwd="46.52.119.2" dyno=web.1 connect=0ms service=6ms status=200 bytes=295 protocol=https
2021-12-20T19:51:47.698594+00:00 heroku[router]: at=info method=POST path="/sendImage" host=MyApp request_id=e1f37539-6242-41cf-9199-5367650b507e fwd="46.52.119.2" dyno=web.1 connect=0ms service=5ms status=200 bytes=295 protocol=https
2021-12-20T19:51:47.699757+00:00 app[web.1]: middleware -> error Error: connect ECONNREFUSED 127.0.0.1:80
2021-12-20T19:51:47.699769+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
2021-12-20T19:51:47.699770+00:00 app[web.1]: errno: -111,
2021-12-20T19:51:47.699771+00:00 app[web.1]: code: 'ECONNREFUSED',
2021-12-20T19:51:47.699771+00:00 app[web.1]: syscall: 'connect',
2021-12-20T19:51:47.699771+00:00 app[web.1]: address: '127.0.0.1',
2021-12-20T19:51:47.699772+00:00 app[web.1]: port: 80,
2021-12-20T19:51:47.699772+00:00 app[web.1]: config: {
2021-12-20T19:51:47.699779+00:00 app[web.1]: url: 'DataURL:[GET]https://file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg',
2021-12-20T19:51:47.699779+00:00 app[web.1]: method: 'get',
2021-12-20T19:51:47.699779+00:00 app[web.1]: headers: {
2021-12-20T19:51:47.699780+00:00 app[web.1]: Accept: 'application/json, text/plain, */*',
2021-12-20T19:51:47.699780+00:00 app[web.1]: DNT: 1,
2021-12-20T19:51:47.699781+00:00 app[web.1]: 'Upgrade-Insecure-Requests': 1,
2021-12-20T19:51:47.699782+00:00 app[web.1]: 'User-Agent': 'axios/0.21.4'
2021-12-20T19:51:47.699782+00:00 app[web.1]: },
2021-12-20T19:51:47.699782+00:00 app[web.1]: transformRequest: [ [Function: transformRequest] ],
2021-12-20T19:51:47.699783+00:00 app[web.1]: transformResponse: [ [Function: transformResponse] ],
2021-12-20T19:51:47.699783+00:00 app[web.1]: timeout: 0,
2021-12-20T19:51:47.699783+00:00 app[web.1]: adapter: [Function: httpAdapter],
2021-12-20T19:51:47.699783+00:00 app[web.1]: responseType: 'arraybuffer',
2021-12-20T19:51:47.699784+00:00 app[web.1]: xsrfCookieName: 'XSRF-TOKEN',
2021-12-20T19:51:47.699784+00:00 app[web.1]: xsrfHeaderName: 'X-XSRF-TOKEN',
2021-12-20T19:51:47.699784+00:00 app[web.1]: maxContentLength: -1,
2021-12-20T19:51:47.699785+00:00 app[web.1]: maxBodyLength: -1,
2021-12-20T19:51:47.699785+00:00 app[web.1]: validateStatus: [Function: validateStatus],
2021-12-20T19:51:47.699785+00:00 app[web.1]: transitional: {
2021-12-20T19:51:47.699786+00:00 app[web.1]: silentJSONParsing: true,
2021-12-20T19:51:47.699786+00:00 app[web.1]: forcedJSONParsing: true,
2021-12-20T19:51:47.699786+00:00 app[web.1]: clarifyTimeoutError: false
2021-12-20T19:51:47.699787+00:00 app[web.1]: },
2021-12-20T19:51:47.699787+00:00 app[web.1]: data: undefined
2021-12-20T19:51:47.699787+00:00 app[web.1]: },
2021-12-20T19:51:47.699787+00:00 app[web.1]: request: <ref *1> Writable {
2021-12-20T19:51:47.699788+00:00 app[web.1]: _writableState: WritableState {
2021-12-20T19:51:47.699788+00:00 app[web.1]: objectMode: false,
2021-12-20T19:51:47.699788+00:00 app[web.1]: highWaterMark: 16384,
2021-12-20T19:51:47.699788+00:00 app[web.1]: finalCalled: false,
2021-12-20T19:51:47.699789+00:00 app[web.1]: needDrain: false,
2021-12-20T19:51:47.699789+00:00 app[web.1]: ending: false,
2021-12-20T19:51:47.699789+00:00 app[web.1]: ended: false,
2021-12-20T19:51:47.699789+00:00 app[web.1]: finished: false,
2021-12-20T19:51:47.699789+00:00 app[web.1]: destroyed: false,
2021-12-20T19:51:47.699790+00:00 app[web.1]: decodeStrings: true,
2021-12-20T19:51:47.699790+00:00 app[web.1]: defaultEncoding: 'utf8',
2021-12-20T19:51:47.699790+00:00 app[web.1]: length: 0,
2021-12-20T19:51:47.699790+00:00 app[web.1]: writing: false,
2021-12-20T19:51:47.699791+00:00 app[web.1]: corked: 0,
2021-12-20T19:51:47.699791+00:00 app[web.1]: sync: true,
2021-12-20T19:51:47.699791+00:00 app[web.1]: bufferProcessing: false,
2021-12-20T19:51:47.699792+00:00 app[web.1]: onwrite: [Function: bound onwrite],
2021-12-20T19:51:47.699792+00:00 app[web.1]: writecb: null,
2021-12-20T19:51:47.699792+00:00 app[web.1]: writelen: 0,
2021-12-20T19:51:47.699792+00:00 app[web.1]: afterWriteTickInfo: null,
2021-12-20T19:51:47.699793+00:00 app[web.1]: buffered: [],
2021-12-20T19:51:47.699793+00:00 app[web.1]: bufferedIndex: 0,
2021-12-20T19:51:47.699793+00:00 app[web.1]: allBuffers: true,
2021-12-20T19:51:47.699794+00:00 app[web.1]: allNoop: true,
2021-12-20T19:51:47.699794+00:00 app[web.1]: pendingcb: 0,
2021-12-20T19:51:47.699794+00:00 app[web.1]: constructed: true,
2021-12-20T19:51:47.699795+00:00 app[web.1]: prefinished: false,
2021-12-20T19:51:47.699795+00:00 app[web.1]: errorEmitted: false,
2021-12-20T19:51:47.699795+00:00 app[web.1]: emitClose: true,
2021-12-20T19:51:47.699796+00:00 app[web.1]: autoDestroy: true,
2021-12-20T19:51:47.699796+00:00 app[web.1]: errored: null,
2021-12-20T19:51:47.699796+00:00 app[web.1]: closed: false,
2021-12-20T19:51:47.699796+00:00 app[web.1]: closeEmitted: false,
2021-12-20T19:51:47.699797+00:00 app[web.1]: [Symbol(kOnFinished)]: []
2021-12-20T19:51:47.699797+00:00 app[web.1]: },
2021-12-20T19:51:47.699798+00:00 app[web.1]: _events: [Object: null prototype] {
2021-12-20T19:51:47.699798+00:00 app[web.1]: response: [Function: handleResponse],
2021-12-20T19:51:47.699799+00:00 app[web.1]: error: [Function: handleRequestError]
2021-12-20T19:51:47.699799+00:00 app[web.1]: },
2021-12-20T19:51:47.699801+00:00 app[web.1]: _eventsCount: 2,
2021-12-20T19:51:47.699801+00:00 app[web.1]: _maxListeners: undefined,
2021-12-20T19:51:47.699801+00:00 app[web.1]: _options: {
2021-12-20T19:51:47.699802+00:00 app[web.1]: maxRedirects: 21,
2021-12-20T19:51:47.699802+00:00 app[web.1]: maxBodyLength: 10485760,
2021-12-20T19:51:47.699802+00:00 app[web.1]: protocol: 'http:',
2021-12-20T19:51:47.699803+00:00 app[web.1]: path: '/[GET]https//file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg',
2021-12-20T19:51:47.699803+00:00 app[web.1]: method: 'GET',
2021-12-20T19:51:47.699803+00:00 app[web.1]: headers: [Object],
2021-12-20T19:51:47.699804+00:00 app[web.1]: agent: undefined,
2021-12-20T19:51:47.699804+00:00 app[web.1]: agents: [Object],
2021-12-20T19:51:47.699804+00:00 app[web.1]: auth: undefined,
2021-12-20T19:51:47.699804+00:00 app[web.1]: hostname: '',
2021-12-20T19:51:47.699805+00:00 app[web.1]: port: null,
2021-12-20T19:51:47.699805+00:00 app[web.1]: nativeProtocols: [Object],
2021-12-20T19:51:47.699805+00:00 app[web.1]: pathname: '/[GET]https//file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg'
2021-12-20T19:51:47.699806+00:00 app[web.1]: },
2021-12-20T19:51:47.699806+00:00 app[web.1]: _ended: true,
2021-12-20T19:51:47.699806+00:00 app[web.1]: _ending: true,
2021-12-20T19:51:47.699807+00:00 app[web.1]: _redirectCount: 0,
2021-12-20T19:51:47.699807+00:00 app[web.1]: _redirects: [],
2021-12-20T19:51:47.699807+00:00 app[web.1]: _requestBodyLength: 0,
2021-12-20T19:51:47.699808+00:00 app[web.1]: _requestBodyBuffers: [],
2021-12-20T19:51:47.699808+00:00 app[web.1]: _onNativeResponse: [Function (anonymous)],
2021-12-20T19:51:47.699808+00:00 app[web.1]: _currentRequest: ClientRequest {
2021-12-20T19:51:47.699809+00:00 app[web.1]: _events: [Object: null prototype],
2021-12-20T19:51:47.699809+00:00 app[web.1]: _eventsCount: 7,
2021-12-20T19:51:47.699809+00:00 app[web.1]: _maxListeners: undefined,
2021-12-20T19:51:47.699810+00:00 app[web.1]: outputData: [],
2021-12-20T19:51:47.699810+00:00 app[web.1]: outputSize: 0,
2021-12-20T19:51:47.699810+00:00 app[web.1]: writable: true,
2021-12-20T19:51:47.699811+00:00 app[web.1]: destroyed: false,
2021-12-20T19:51:47.699811+00:00 app[web.1]: _last: true,
2021-12-20T19:51:47.699811+00:00 app[web.1]: chunkedEncoding: false,
2021-12-20T19:51:47.699812+00:00 app[web.1]: shouldKeepAlive: false,
2021-12-20T19:51:47.699812+00:00 app[web.1]: maxRequestsOnConnectionReached: false,
2021-12-20T19:51:47.699812+00:00 app[web.1]: _defaultKeepAlive: true,
2021-12-20T19:51:47.699813+00:00 app[web.1]: useChunkedEncodingByDefault: false,
2021-12-20T19:51:47.699813+00:00 app[web.1]: sendDate: false,
2021-12-20T19:51:47.699813+00:00 app[web.1]: _removedConnection: false,
2021-12-20T19:51:47.699813+00:00 app[web.1]: _removedContLen: false,
2021-12-20T19:51:47.699814+00:00 app[web.1]: _removedTE: false,
2021-12-20T19:51:47.699814+00:00 app[web.1]: _contentLength: 0,
2021-12-20T19:51:47.699814+00:00 app[web.1]: _hasBody: true,
2021-12-20T19:51:47.699814+00:00 app[web.1]: _trailer: '',
2021-12-20T19:51:47.699814+00:00 app[web.1]: finished: true,
2021-12-20T19:51:47.699815+00:00 app[web.1]: _headerSent: true,
2021-12-20T19:51:47.699815+00:00 app[web.1]: _closed: false,
2021-12-20T19:51:47.699815+00:00 app[web.1]: socket: [Socket],
2021-12-20T19:51:47.699817+00:00 app[web.1]: _header: 'GET /[GET]https//file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg HTTP/1.1\r\n' +
2021-12-20T19:51:47.699818+00:00 app[web.1]: 'Accept: application/json, text/plain, */*\r\n' +
2021-12-20T19:51:47.699818+00:00 app[web.1]: 'DNT: 1\r\n' +
2021-12-20T19:51:47.699818+00:00 app[web.1]: 'Upgrade-Insecure-Requests: 1\r\n' +
2021-12-20T19:51:47.699818+00:00 app[web.1]: 'User-Agent: axios/0.21.4\r\n' +
2021-12-20T19:51:47.699819+00:00 app[web.1]: 'Host: localhost\r\n' +
2021-12-20T19:51:47.699819+00:00 app[web.1]: 'Connection: close\r\n' +
2021-12-20T19:51:47.699819+00:00 app[web.1]: '\r\n',
2021-12-20T19:51:47.699819+00:00 app[web.1]: _keepAliveTimeout: 0,
2021-12-20T19:51:47.699820+00:00 app[web.1]: _onPendingData: [Function: nop],
2021-12-20T19:51:47.699820+00:00 app[web.1]: agent: [Agent],
2021-12-20T19:51:47.699820+00:00 app[web.1]: socketPath: undefined,
2021-12-20T19:51:47.699820+00:00 app[web.1]: method: 'GET',
2021-12-20T19:51:47.699820+00:00 app[web.1]: maxHeaderSize: undefined,
2021-12-20T19:51:47.699821+00:00 app[web.1]: insecureHTTPParser: undefined,
2021-12-20T19:51:47.699826+00:00 app[web.1]: path: '/[GET]https//file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg',
2021-12-20T19:51:47.699826+00:00 app[web.1]: _ended: false,
2021-12-20T19:51:47.699826+00:00 app[web.1]: res: null,
2021-12-20T19:51:47.699827+00:00 app[web.1]: aborted: false,
2021-12-20T19:51:47.699827+00:00 app[web.1]: timeoutCb: null,
2021-12-20T19:51:47.699827+00:00 app[web.1]: upgradeOrConnect: false,
2021-12-20T19:51:47.699828+00:00 app[web.1]: parser: null,
2021-12-20T19:51:47.699828+00:00 app[web.1]: maxHeadersCount: null,
2021-12-20T19:51:47.699828+00:00 app[web.1]: reusedSocket: false,
2021-12-20T19:51:47.699829+00:00 app[web.1]: host: 'localhost',
2021-12-20T19:51:47.699829+00:00 app[web.1]: protocol: 'http:',
2021-12-20T19:51:47.699829+00:00 app[web.1]: _redirectable: [Circular *1],
2021-12-20T19:51:47.699829+00:00 app[web.1]: [Symbol(kCapture)]: false,
2021-12-20T19:51:47.699830+00:00 app[web.1]: [Symbol(kNeedDrain)]: false,
2021-12-20T19:51:47.699830+00:00 app[web.1]: [Symbol(corked)]: 0,
2021-12-20T19:51:47.699830+00:00 app[web.1]: [Symbol(kOutHeaders)]: [Object: null prototype]
2021-12-20T19:51:47.699831+00:00 app[web.1]: },
2021-12-20T19:51:47.699831+00:00 app[web.1]: _currentUrl: 'http:/[GET]https//file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg',
2021-12-20T19:51:47.699831+00:00 app[web.1]: [Symbol(kCapture)]: false
2021-12-20T19:51:47.699832+00:00 app[web.1]: },
2021-12-20T19:51:47.699832+00:00 app[web.1]: response: undefined,
2021-12-20T19:51:47.699832+00:00 app[web.1]: isAxiosError: true,
2021-12-20T19:51:47.699832+00:00 app[web.1]: toJSON: [Function: toJSON]
2021-12-20T19:51:47.699833+00:00 app[web.1]: }
i think this is because at app launce i can see that App assumed it is running on local host Port 127.0.0.1
or maybe Heroku may prevent calls to outside which i can't find in the Docs.