Public IP address of the network router where Alexa is connected - alexa

How can I send the public IP address where Alexa is via a url. I have to make an http GET request where I put as a parameter the public IP address of the Alexa network (IP Router).

You can not access that information from the skill. If you could, that would be a huge security issue.

Related

Unable to access mule-worker external URL from clients network

I have a mule application deployed on cloudhub. My client is trying to trigger the mule-worker URL (http://mule-worker-appname.us-e2.cloudhub.io:8081) from his network (connecting to their VPN), but it is giving Timed Out error. However, when he tries to hit with SLB URL (http://appname.us-e2.cloudhub.io) he is getting the response.
When client disconnects his VPN then worker URL is also working.
Can someone explain why the worker url is not working where as SLB url is working? I thought worker external url is a public url and can be accessed, then why there is a restriction from their network? Is there some firewalls that client must be having?
When accessing the worker directly (ie using http(s)://mule-worker-myappname.region.cloudhub.io:port) you have to add explicitly the default HTTP (8081) or HTTPS (8082) ports to the request. Example: `http://mule-worker-testapp.us-e2.cloudhub.io:8081)
Also if in the VPC firewall those ports are blocked of access from anywhere (ie public Internet access) you may not be able to access.

Camel rest - Allow specific ip to access send request

I have below camel rest route. Currently all the host is able to access this route using the URL exposed.
Is there anyway I can restrict remote host to access based on the IP configured.
I want to allow certain IP address to access this URL. Is there any configuration in camel available to handle this ?
rest("/api/")
.id("reset-api-route")
.get("/reset")
.to("direct:resetRoute");
With camel-netty4-http component you can have remote IP address in the headers.
However it might make more sense to make network level isolation on firewall before your application.
With camel-netty4-http you can inspect and do logic with remote IP like this:
#Override
public void configure() throws Exception {
restConfiguration()
.component("netty4-http")
.host("localhost")
.port(8000)
.bindingMode(RestBindingMode.auto);
rest("/api/")
.id("reset-api-route")
.get("/reset")
.to("direct:resetRoute");
from("direct:resetRoute")
.log("${in.headers.CamelNettyRemoteAddress}")
.choice()
.when(header("CamelNettyRemoteAddress").startsWith("/127.0.0.1:")) // localhost
.transform().constant("allowed").endChoice()
.otherwise()
.transform().constant("denied");
}
If your Camel application is running inside Spring-Boot then you can use Spring Security IP filtering. Also keep in mind that if your application is behind load balancer then depending on the load balancer you might always see the load balancer's address instead of the original caller.

Alexa audio streaming skill http

Can somebody explain how get http url to https url. I wont to put SHOUTcast stream radio url (http://live.narodni.hr:8063/stream) in Alexa skill but can't figure out how. :(
Skill work great with https url. but I want specific radio to use in Alexa skill
Please help
Use of HTTP vs HTTPS (secured HTTP) is determined by the owner of the service.
Unless the person that owns the service has a HTTPS endpoint, you'll be stuck running on HTTP.
Normally when you make a request a HTTP endpoint, it'll default to port 80 whereas HTTPS endpoints default to port 443.
From your URL above, it looks like the owner of live.narodni.hr opened up port 8063 and used that port to listen for HTTP requests. If you can find if and where they have a HTTPS port, then that should work.
You may want to to just try https://live.narodni.hr/stream which will use port 443 which is equivalent to https://live.narodni.hr:443/stream. For testing, some people like to use port 8443 too (8080 for http), so you can try https://live.narodni.hr:8443/stream.
TL;DR - it's up to the service owner to enable/support an HTTPS endpoint. Find that endpoint and you'll be good.

IdentityServer Resource Owner flow for specific IP

I'm using IdentityServer 4 and I wish to allow Resource Owner flow but only for a client with a specific IP address. How can I configure it?
You can simply inject the IHttpContextAccessor into your resource owner validator. This will give you access to the HTTP request.
This way you can check the IP address.

How to get IP address of chat message sender using XMPP protocol in Google App Engine?

I am developing an app which can respond to user's chat message. I need to know the IP address of the chat message sender. I am doing my app on Google app Engine and using XMPP protocol for chatting purposes. How to detect IP address of a chat message sender using XMPP protocol?
Only the XMPP server knows the IP address. If you control the XMPP server you can write an extension to include the IP address in the messages somehow (or check if one is already available).
How to get my public IP from XMPP bind message?
http://xmpp.org/extensions/xep-0279.html
First the client sends an IQ-get request to its server.
Example 1. Client requests its IP address from the server
<iq from='romeo#montague.lit/orchard'
id='ik2s7159'
type='get'>
<address xmlns='urn:xmpp:sic:1'/>
</iq>
The server then returns an IQ-result containing an element containing an element specifying the client's external IP address and, optionally, a element specifying the client's external port.
Example 2. Server returns IP address and port
<iq id='ik2s7159'
to='romeo#montague.lit/orchard'
type='result'>
<address xmlns='urn:xmpp:sic:1'>
<ip>192.168.4.1</ip>
<port>12345</port>
</iq>
Note that the IP address could be IPv4 or IPv6.
Example 3. Server returns IPv6 address
<iq id='ik2s7159'
to='romeo#montague.lit/orchard'
type='result'>
<address xmlns='urn:xmpp:sic:1'>
<ip>2001:db8::9:1</ip>
<port>12345</port>
</address>
</iq>

Resources