Invalid URL for Subscription API: Instagram - api

I'm attempting to test a real-time Instagram stream using the Subscription API, but am having trouble setting up subscriptions for local testing.
I attempted using localhost:8080 for the callback_url and editing my /etc/hosts file (redirecting localhost to local.machine.com)
Eventually, I was able to set up a subscription to my home's IP address to receive callbacks from Instagram.
The IP address was in the form:
xxx.xxx.xxx.xx:8080
However, this morning, I was trying from a different IP address in the form xxx.xxx.x.xx:8080 which has continuously led to Instagram returning 400: Bad Request: Invalid URL
Does anybody have any insight as to what Instagram treats as a valid URL parameter for subscriptions?

I would recommend ngrok for this.
It allows you to set up a tunnel between your local machine and the internet.
With ngrok you can on the command line do like this:
ngrok http 8080
That will give you a url like this: http://something.ngrok.io. In your terminal window you can also inspect all traffic through this tunnel.

Related

Ngrok and webhooks

I got a problem on my app, and i'm newbie on this tehcnology ...
I have an express app on a heroku url (https://my-website.heroku.com)
I've also this project on a localhost. I want to use the prismic webhook to do some stuff when a document is published.
I try to use ngrok to:
connect it to the heroku website
detect when my /webhook route is called on the heroku app to dispatch it on my localhost server (which is the same project, but I don't know how to do this with ngrok (I used some commands but nothing happen :/ )
Can you help me please ? Thank you !
I might be misunderstanding your use case, but it sounds like what you're wanting to do is handle or detect an incoming request to your heroku app and then proxy or forward that request to your localhost.
One way to handle this would be to -- in response to the original event or request -- then make a second request like a POST request to the Ngrok URL linked to your localhost machine from your heroku app. Ngrok itself is not a real proxy server, it just links two instances of URL/DOMAIN:PORT to each other where one of these runs in the Ngrok cloud service.
So in the code you have handling or receiving the webhook request on the heroku app, you could there make, say, a POST request to the Ngrok URL for your localhost and that request would be forwarded to your localhost machine. I'm not sure what data or information you want to see in localhost but you could pass along any incoming request data in the POST body to your localhost Ngrok URL and then see the same data locally.

Express Gateway: 'warn: unable to verify the first certificate' Express.js

I'm brand new to Express Gateway and I'm trying to set up a basic API Gateway to link up some micro services. When I try and proxy to a specific end point https://my-service.net/status (not the real URL), I get this error
[EG:policy] warn: unable to verify the first certificate
I can access the URL 'https://my-service.net/status' in the browser just fine.
When I switch out the serviceEndPoint URL it works fine (e.g. to https://httpbin.org), so it seems like there's something different with my URL in terms of the SSL/authentication config.
Any ideas? Many thanks.
My gateway.config.yml -->
So the SSL setup allows me to access the page from a browser (Chrome), but at the command line (e.g. through my Express Gateway which is served by NPM and running locally on port 8080) it fails.

Ngrok How can I forward to a specific URL?

I have a web app thats running on local. I try to use ngrok for webhooks but ngrok open the whole app to the world.(I dont want to use ngrok -auth because of some reasons.)
I want to ngrok forwards just for webhooks. For example:
Forwarding http://xxxxx.ngrok.io -> localhost:80/webhook
Is that possible for ngrok?
Or Can I re-forward ngrok request in apache? I mean;
Ngrok forwards to localhost:80 and apache detect request coming from ngrok and re-forward to localhost:80/webhook.
If you want requests to be forwarded to localhost:80/webhook, then wherever you are specifying the call-back for your service, set it as http://xxxxx.ngrok.io/webhook.
You can use https://webhookrelay.com and specify the endpoint where you want your webhook to be delivered by appending to this URL:
relay forward --bucket my-app http://localhost:80/webhook
This way your app will not be exposed to the world. Webhook Relay has two modes:
forward where it only opens one-way tunnel (nobody can get responses from your app so it's a safe way to deliver webhooks)
connect where it creates a bidirectional tunnel which is very similar to what ngrok does. It does, however, add a bit more on top of it like let's encrypt certs, basic/token auth and on-the-fly content minification.

Mikrotic SSL Https Error

I'm trying to build an hotspot with mikrotik to allow the internet to my clients! So, the problem starts when i'm trying to access sites with Https sercurity like facebook, before the user authenticates.
With normal http connection the hotspot works fine, but when i put https, i'm getting this error: error
Can someone please help me? I have read all the docs in the mikrotik forum, nothing worked!
it's good news that nothing worked because it's the purpose of HTTPS: ensure that the site you want is the site you get. Hotspot does exactly the reverse: you ask for a website and you get another one (hotspot landing page): error.
There is no workaround without installing your certificate on each client, which is not doable on a hotspot environment.
Hopefully, problem has been handled with CNAs (Captive Network Assistants) which detect hotspot presence and launch an automatic HTTP request before the user has time to launch its own browser and navigate to Facebook. Latest iOS/Android/Windows versions do that automatically.

Application proxy returning 404

I've set up an application proxy for my app, but when I try to access the URL in my test shop, it returns a 404 error.
Proxy URL: http://localhost:3000
Path: tools/track
Test Shop Proxy URL: http://harber-inc8996.myshopify.com/tools/track
When I go to that proxy URL (which I believe you can see for yourself), it returns a 404 error.
Now that I'm writing this out, I'm wondering...is the issue that the Proxy URL can't be localhost?
You can't use localhost as a proxy.
The reason behind this is that Shopify actually has to be able to send a request to the proxy location. From Shopify's perspective localhost is... itself.
You have to provide a publicly accessible address for your proxy.
There are a couple of ways to do this. The easiest/most popular way to go is either with localtunnel or showoff.io. Localtunnel is free but gives you different URL every time you start it. Showoff will give you a permanent address but costs money. Such is life.