axway-streams / axway-amplify-streams-js

AMPLIFY Streams Javascript package containing SDK, documentation and sample applications
https://www.axway.com/en/products/api-management/manage-apis/amplify-streams
Apache License 2.0
78 stars 27 forks source link

An error occurred while streaming localhost URL #4

Open srikanthraj opened 6 years ago

srikanthraj commented 6 years ago

Hi,

I am using a localhost URL that gives me a JSON response. The issue is when I am using the URL in my Node js application. var targetUrl = 'http://localhost:3000/suvs';

, I am getting an error: " { status: 2004, cause: 'An error occurred while streaming http://localhost:3000/suvs. : Connection refused', message: 'Network error. The proxy cannot connect to host. Please try again later.', timestamp: 1538521423798, sessionId: '77229760-cda3-414e-8606-db67c5f60281' } ERROR! StreamDataError { type: 'An error occurred while streaming http://localhost:3000/suvs. : Connection refused', message: 'Network error. The proxy cannot connect to host. Please try again later.', status: 2004, original: { status: 2004, cause: 'An error occurred while streaming http://localhost:3000/suvs. : Connection refused', message: 'Network error. The proxy cannot connect to host. Please try again later.', timestamp: 1538521423798, sessionId: '77229760-cda3-414e-8606-db67c5f60281' }, source: 'server' } Closing the SSE Stream.

" This works perfectly fine when I use the URL provided by you (stockmarket.streamdata.io/prices).

Can you please help me? Could it be because the URL you provided redirects to HTTPS and my URL is HTTP?

allandenis38 commented 6 years ago

Hi @srikanthraj ,

The URL you provide to the JS SDK will actually be requested from our cloud hosted proxy. Thus, it must to be accessible from internet. You can either assign an public IP address or a domain name to it. Hope it helps. BR Allan

srikanthraj commented 6 years ago

Thanks !! Can you please tell me how do I do that ?

Thanks

Sent from my iPhone

On Oct 3, 2018, at 12:28 AM, allandenis38 notifications@github.com wrote:

Hi @srikanthraj ,

The URL you provide to the JS SDK will actually be requested from our cloud hosted proxy. Thus, it must to be accessible from internet. You can either assign an public IP address or a domain name to it. Hope it helps. BR Allan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

allandenis38 commented 6 years ago

Hi, I am sure you can find many tutorials on google to help you on that. Here an example: https://www.pluralsight.com/guides/exposing-your-local-node-js-app-to-the-world