-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this SDK with ngrok or a local host #73
Comments
You could support local testing by creating an express wrapper around the handler function. var Alexa = require('alexa-sdk');
exports.handler = function(event, context, callback){
var alexa = Alexa.handler(event, context);
}; You could then create a file called local.js which creates an express app that calls the handler function and returns the result. I did something like this a few weeks ago to facilitate local testing for a skill but the solution is not ideal because the Lambda Context object needs to be mocked (it's passed in as a parameter to the Alexa handler function). With a bit more work, and some changes to the SDK, we could easily facilitate this. In the meantime, the work-around i described above would work. |
Potentially relevant alexa-js/alexa-app-server#13 |
Running a test on localhost through TLS to an HTTPS connection over open web poses security risks. The local web server that ngrock is running will not contain a key/certificate pair, which is required for transport layer security (TLS) connection to an authenticated server. You can still connect, using the insecure parameter with the curl command, but you will not be using a hypertext transfer protocol with an encrypted connection, opening multiple vectors to the attack surface of your computer. Since you're planning on tunneling to an HTTPS site, I'm going to assume that's where your service for your actions are hosted, and you've configured them to respond properly once you make the request to the service. If it were me, and you have your service hosted on a server that supports TCP tunneling, (and you don't have the auth credentials for full TLS) I would make sure that the server is accepting incoming connections on port 22 from the public IP address of your computer, and test invoking my actions through the SSH tunnel. I have no idea if a TCP tunnel would even work, it's just speculative opinion after reading through some documentation. You'd have to test that on your own. As stated above, the Alexa Skills SDK and AWS Lambda are a perfect architecture match. It would be much easier, at this current state in the development process, to engineer your cloud services for an AWS Lambda. Good luck. Edit: Spelling |
I think this should be re-opened, since at least @bclement-amazon proceedings could be documented. Following the Alexa docs, choosing |
To be precise: the issue should not be around the tunnel, but local development or |
Here's a repo showing how to create the Express wrapper around a skill to run it locally: |
I posted an approach to doing this up at the SO question noted above |
hello ,
How can I use this npm with ngrok instead of using it with AWS lambda ? where ngrok tunnels the local host to a secure public ip HTTPS.
The text was updated successfully, but these errors were encountered: