Monitoring outbound server http header information? - linux

What tool / function can we use on our linux server running CentOS to monitor the http headers that are sent from our application to another application on a different server? Looking for http header monitoring from server to server. My issue is I have no idea how to capture the data sent from the server, meaning the http headers sent via a post. I have tried many methods and third party software's like fiddler2 and ieinspector and the list goes on, but they only seem to capture the client headers and not what is being sent out from the server. I just need to capture the string being sent out via a post function and what is being returned. Seems simple, yet in this case, I'm beyond lost and running out of time to resolve what should be a simple solution. Please advise & thank you kindly.

Related

GraphQL subscription does not receive messages after successful handshake

I have created a simple GraphQL Subscription using Nest.js/Apollo GraphQL over Node.js. My client application which is a react.js/apollo client works find with the server. The client subscibes to the server via GraphQL similar to:
subscription
{
studentAdded
{
id
}
}
My problem is that it works only locally. When I deploy my server back-end to a hosted docker over internet, client won't receive data anymore.
I have traced the client, it sends GET request on ws://api.example.com:8010/graphql and receives the successful HTTP/1.1 101 Switching Protocols response. However, nothing is received from server like when the server was on my local machine. Checking the remote server log showed me that the client successfully connects to server. There, I can see onConnect log messages.
Now I need any guidance to solve the problem.
I check several things myself. Firstly, I thought WebSocket address is prohibited in the network but then realized that it is on same port as normal HTTP. Secondly, supposed that WebSocket messages/frames are transmitted over UDP but I was not correct, it is over TCP and no need to worry about network settings.
Additionally I have read several github threads and StackOverflow questions. But did not find any clue. I am not directly using Node.js/WebSocket, instead, I am using Nest.js/GraphqQL subscription. It has made my search tougher.
Your help is highly appreciated.

How to send http request as sending from another ip in React/Node

Using frameworks : React/NodeJs
I'm trying to play video streams from a video source provider that having good security. I'm handling all data and communication from my server side and sending required data for client running on browser.
there is a special request that need to execute from client side. that will enable client's ip address allowed for streaming from streaming server.
If I send this special request from my server then, the streaming server allowing only for my server ip address. So client will get '403 (Forbidden)' error when streaming on his browser.
I need a way to do this somehow. So my questions are,
1) Is there any way to send that request from client's browser (Failed because of CORS). I don't need the response. but need to send request to streaming server by client's real IP address?.
2) If I handle that request from my server side is there any way to set the requesting IP address to fake(client's) IP?(Don't need get the response)
Thanks for any idea
An IP address can not be forged in Node. Maybe there are specialists who can do it at the kernel level of the system, but it seems to me that I have mistaken IP with MAC.
You will have to do streaming through your servers.

How to capture full http requests on express to request them again to my localhost

I have a problem with an Express.js service running on production that I'm not able to replicate on my localhost. I have already tried requesting all the urls to production again to my local machine, but on my machine everything works fine. So I suspect that the problem comes with the data on the http headers (cookies, user agents, languages...).
So, is there a way, (some express module, or sniffer that runs on ubuntu) that allows me to easily create a dump on the server with the whole header so I can later repeat those exact requests to my localhost?
You can capture network packages with https://www.wireshark.org/, analyze them and maybe find the difference between your local environment and the production one.
You can try to use a Proxy-Tool like Charles (https://www.charlesproxy.com/) or Fiddler (http://www.telerik.com/fiddler) to log your Browser Requests.

Load balancing: Is there a way to tell from the client side, which server is currently being targeted by the load balancer?

We have a load balanced website. It connects to 6 different servers. Is there any way (ping or otherwise) to determine from the client side, which server the load is being passed to by the load balancer?
You could set a cookie that contains this information.
After some research Ive realized that you can get some information like the web server IIS version etc by looking at the HTTP header response. But you cannot tell from the client end which server this response originated from. Long story short, what is behind the load balancer is opaque to the user at the client end.

Will the BITS service follow HTTP redirects

I have a server that is serving files to several windows clients using the Background Intelligent Transfer Service (BITS). If I would like to direct those clients to another server, could I do that by configuring IIS to return an HTTP redirect response to the new service?
Would that work for files that are in progress (but accessed via a RANGE request).
Thanks!
The answer to my question was "Yes" :)

Resources