Is there way to send image file to nest micro-service (TCP) from HTTP nest server? - file-upload

We using nestjs framework for backend and frontend is react nextjs, Now we trying to upload image.
i upload image from react to nest gateway which is http server using multer, but i want to send the image file to nest by client proxy microservice which is TCP server, we using client proxy to send data to microservice (tcp) server.

Related

NGINX Request Manipulation?

I have an NGINX config in an API gateway repo that handles requests and routes them to back-end microservices.
Currently I have it so users can use REST to easily make requests. The requests get handled and routed to the appropriate microservice with NGINX.
However, the back-end services also have gRPC integrated. Ideally, I want it so that users can pass in REST requests to the API gateway (easier for external clients), and then I can translate the REST (JSON) to gRPC (protobuf) to route the requests with gRPC (faster for internal communication) to the back-ends.
I believe it would require some sort of middleware in the API gateway that intercepts requests, translates them to protobuf, and then routes them with gRPC pass using NGINX. Is there a way to intercept or manipulate incoming requests on the fly with NGINX?
I found this http://web.archive.org/web/20180322022735/https://tarunlalwani.com/post/request-capturing-nginx-lua/
Which essentially logs the requests that come into NGINX. I feel like it may be on the right path, but I would need to manipulate the requests before they are routed. Maybe a separate script called before the proxy path so instead of logging after the request is routed, the request can be changed before?

Electron as a local API server responding to http requests?

I have a an electron app that renders a visualization. I need to have a different local application send an http request with parameters to my electron app which will then return a png or svg image based on the parameters. Can electron respond to external http API requests out of the box or do I need to integrate an express server within my app that will allow this? Having trouble finding documentation about this.
Electron does not have any built in modules for creating HTTP APIs.
However, both Electron processes (the main process as well as renderer processes) are Node processes, which means you have access to all Node APIs, including http - so you can build servers just as you would with Node. express would certainly make it easier.

Capture Amazon S3 requests from Tomcat using fiddler

My web application sitting in tomcat reads the files in Amazon S3 buckets. Is there a way to capture the request? I am not sure what protocol it uses. (s3?) I would like to capture this request using fiddler.
Any idea?
As far as I know, S3 typically uses HTTP/HTTPS for communication (REST, SOAP). Are you using a library to make your S3 calls? The library may not use the default proxy.
As you know, Configuring Tomcat to communicate through proxy in Localhost - Fiddler has general details on how to configure Tomcat to use the Fiddler proxy.

Sending a message directly form a Rails app to a Node.js and Socket.io push server

I'm building a client side Browser app that uses a server side json API written in Ruby Rails 3 via AJAX. this all works great, no problems. but I want to push data to the users client when other users do things via the API with out having to have the client constantly be polling the server for new data.
so I set up a Node.js and Socket.IO app to act as a push server. Clients connect tot he Socket.IO server and subscribe to the channels they need to. but question is How can I get the Rails app to send a message to the Node server to be emitted on those channels?
I suppose I could just generate a post request to a special rout on the Node server but is there a better way? and how can I ensure that post request came form my rails app?
Use a Redis (redis.io) Pub/Sub channel to publish a message from your rails app, and subscribe to the Redis channel from the Node.js app.

How to build a proxy layer for SOAP/XML webservices

I need to capture and run realtime analysis on messages being exchanged between various web services implemented in Java and client apps. The server code and config can not be modified and is hosted on various servers.
Is it possible to build a proxy layer that will take all calls from the client app and route them to actual web services.
So it needs to do the following:
Accept a config file containing endpoints for various web services that need to be proxied
For each end point, generate a proxy URL
The client apps will point to these proxy URLs
The proxy layer will listen to traffic on these proxy URLs, and route them to real end points.
Track all SOAP traffic in between the client and services and run the necessary analysis.
I considered SoapUI but it does not seem to provide enough control that I need for realtime analysis.
You should start with WCF Routing service. Once you have working communication you can add some custom message processing through custom behaviours or channels to grab SOAP messages and do your analysis.