Communicate with api server using nsis - nsis

I tried nsis for the first time.
You want to send a post to the api server using nsis.
I used the inetc module, the InetLoad module, and the nsJSON module
All communication is not possible.
Help me, I do not feel at all.
For example, if you have headers, data, and url, you know how to use the module. Please.
I am trying to communicate with the api server using inetc :: post
Pop Returns OK from $ 0.
However, if you look at the server logs, you will see a header check fail.
Why?

Related

Not able to verify callback on Gupshup WhatsApp APIs

I am following this guide to build NodejS bot using Gupshup whatsapp https://www.gupshup.io/developer/docs/bot-platform/guide/gupshup-bot-library-for-node
I am running the code and getting the ngrok URL:
But when following steps are given, I get an error as below:
Not sure what is wrong here. Please let me know how can I solve this issue?
Sometimes ngrok service can be not reachable (for any reason).
First - make sure you can open ngrok link in the browser or by curl and make sure it reaches your server api.
Also if your backend check incoming requests for specific app key in header, you should also add it to url params, due to you have no way to manage GupShup api caller.
for the first time setting callback you need to return a 200 status.
res.status(200).send('ok');
Use this as first line for first time for setting callback and after call back is set you can comment this out. And save and relauch your code (make sure address of your hosted code is same don't restart ngrok :P) is same

HTTP Calls integration pattern- Making HTTP calls directly from Javascript vs Axios vs Node, which is more secure?

A novice javascript developer here!
A have a basic question on whats the best and secured way to make HTTP calls from a front application to a backend service that needs an authentication. My application is a SPA (using Vue.js) & getting data from Java services. Java services need authentication details and return sensitive user data.
I see there are a few options and I wanted to understand a better approach amongst all 3-
Making direct HTTP calls from javascript code- Concern for using this approach is, as Javascript code can also be viewed via dev tools in browser, wont it be easier for anyone to do an inspect and view all critical authentication details hence making overall integration less secure?
Making an HTTP call using Axios via Vue framework- Seems like Axios is Promise based HTTP client for the browser that lets you easily make HTTP calls without much code overhead. but is this secure? is Javascript code loaded in the browser? Or the front end code sends the request and axios makes the request from backend server where the application is hosted?
Using Node- If front end application has unique routes configured for each API call and in my application if I have a route mapping to use request module and node js backend code to make those HTTP calls, is that going to be a robust and secure way of integration?
Please let me know your thoughts and apologies if this is a dumb question!
Not dumb at all. You're just learning.
My first question to your answer 😅 will be: is your application server-side rendered or it's sap + backend?
If it's server-side rendered then I would say it's secured since Node will be sending pages with all required data. On the dev tool, you will only see static files being loaded.
However, if it's SAP, I am not sure whether there is a way to hide whatsoever you send to the server from the dev tool. The only one thing you will need to do is to make sure you encrypt whatever is sensitive to your application.

Modifying content delivered by node-http-proxy

Due to some limitations about the web services I am proxying, I have to inject some JS code so that it allows the iframe to access the parent window and perform some actions.
I have built a proxy system with node-http-proxy which works pretty nicely. However I have spent unmeasurable hours trying to modify the content (on my own, using harmon as well, etc) that is being sent to the user without any success. I have found some articles and even some questions here but all of them are outdated and are not useful anymore.
I was wondering if someone can give me an actual example about how to do this, because I am unable to do it and maybe it is just that it is impossible to do at this point?
I haven't tried harmon, but I did try cheerio and it works.
However, I used http-mitm-proxy and not node-http-proxy.
If you are using http-mitm-proxy, you need to return a promise in the response handler. Otherwise, the proxy continues to send the original response without picking up your changes.
I have recently written another proxy at:
https://github.com/noeltimothy/noelsproxy
I'm going to add response handling to this soon. This one uses a callback mechanism, which means it wont return the response until the caller signals it to.
You should be able to use 'cheerio' and alter the content in JQuery style.

How can i use tropo module with node.js?

In my application i need to use tropo application with node.js to send,receive message and call and answer phone calls.I saw the documentation but i didn't get any idea.Can anyone help me.
Disclaimer - I have never worked with tropo, but this is how I understand it works:
You write a script that tropo can parse, in most languages, to perform some function.
You link up that script to a number using tropo's web interface.
You / a client phones that number, tropo fetches your script and executes it.
Here is a full walkthrough of how everything above works: https://www.tropo.com/docs/scripting/creating_first_application.htm
NOW, if you want your script to do dynamic things, you need to host it yourself. For this you can use node.js:
You write a script that changes based on time / user data in node.js
You link up the script using tropo's web interface.
When someone calls / texts the number, tropo now fetches the dynamic script from your node.js server.
This node.js api can be used to write scripts on your node server: https://github.com/tropo/tropo-webapi-node, https://www.tropo.com/docs/webapi/new_tropo_web_api_overview.htm
Finally, you might want to dynamically create different scripts for different users and hook them up to individual numbers. At this point you use the REST API to automate the "number hooking up work" you used to have to do manually on tropo's website. You can use any node REST client, like request to do this. Here are the API docs: https://www.tropo.com/docs/rest/rest_api.htm

how to integrate node.js into a kohanaPHP application for real time status update notification

I wish to add real time status update notification to a kohanaPHP application with MySQL database i'm developing using node.js, while looking around, i could not find any tutorials about integrating node.js in PHP, i will like to know if its possible and how can it be done and what type of servers should i host the php website on. From what i got its seems node.js does not work on Apache servers. i'll be grateful for help.
Node is it's own server so what you want to do is make a request to the node.js application. You can do this with Curl. One other way is to use Kohana's HMVC feature to make an external request. This example assumes your node.js app returns json.
//Make an external request using post.
$json_request = Request::factory('http://www.example.com/path/to/nodejs')
->method('POST')
->post('my_key', 'value')
->headers('Accept','application/json')
->execute();
//Get the json from the request.
$json_string = $json_request->body();
//Turn the json string into an array.
$json_array = json_decode($json_string);
//Take a look at it with debug.
echo Debug::vars($json_array);
First: You don't run node in any Apache or other web server. It's its own server. So you need to implement data exchange between your Apache/PHP server and node.
You can call your node program via a HTTP request from PHP as soon as something changes and push the new data into your node.
That way you don't need access to MySQL for node, which is not available yet anyway.

Resources