Thrift - send files from server to client - client-server

I am using thrift and I have a java client and server. I am calling some functions on the server from the client and that part is already working. After calling the functions, I have an output file created in the machine where the server is running. I need to return this file to the client. How can I accomplish this? Should I use TFileTransfer? If not, is there a better way to get the data back?
In a sense, I need to create a client within the server..
I am new to Thrift and any help will be appreciated.

Related

Laravel server to client communication

I need to implement a server to client communication. Long polling sounds like a non-optimal solution. Sockets would be great. I'm looking at this package:
https://github.com/beyondcode/laravel-websockets
My server is running on AWS Elastic Beanstalk (with a second worker environment for queue and cron).
Does anyone have experience setting up a socket connection in Elastic Beanstalk? In particular, how can I start up a socket server using ebextensions (or any way at all). Looks like I should be using supervisor for the server.
Should this server live in the worker environment? Can it? I don't know much about the moving parts here. Anything is helpful :)
Laravel comes with out of the box broadcasting tool : Laravel Echo.
And you can either use it with a local instance (by deploying Redis for example), or you can use an API or an external tool (Socket.IO, Pusher ..)
Take a look at the documentation https://laravel.com/docs/5.8/broadcasting

RPC authenthification explained with windows api

I would like to make a IPC between two processes using Windows RPC. Please explain me like I am five how my application should achieve good security. I want to use ncalrpc protocol (processes on the same computer). More exactly:
How my client application knows that the server is trusty?
How my server know if the callee is the trusted one?
What options do I have? I didn't get RpcBindingSetAuthInfo function.
Thanks
For a local connection having the client authenticate the server is fairly hard (for example confirming that some other service did not start in place of the desired program) but having the server identify the client is not, call RpcBindingInqAuthClient and use the username to determine what action to take, or just use RpcImpersonateClient if you can rely on existing secured objects. Most of the RPC security apparatus is for remote connections rather than ncalrpc.

Server to server transfer using AJAX

This questions was asked during one of the interview. How to transfer data from one server to another using AJAX? Is it really possible?
AJAX is generally used on the client side, not usually the server side.
It sends requests to a server.
You probably need to provide more information about what you are trying to achieve to get a decent answer.
If you are wanting to transfer data from a "client" to a server then you could send the data in a variety of ways - especially with AJAX. Just how depends on what data type and size. Requests from a client to server (HTTP) can include POST data, which can carry your data to the server.
If you are using AJAX on a client and wanting to use it to transfer data from one remote server to another then you could get AJAX on your client to call a script on the server that would instigate the transfer from the server to another server in some way. (such as FTP or SCP maybe - or even using a server to server HTTP POST)
If you can be a little more specific about what you need to do then I will try and give you a better answer.

Client-Server implementation for uploading a file using Socket

I want to implement a Client-Server program in which the client has to send a file to the server. In this case, what is the efficient way to send the file to server?
I am thinking in the following method,
After the connection establishment, First, I have to send the file name (which i want to upload) to server from client. Then I have to send the file content to server. The server will wait for the file content after received the file name from client.
So, for uploading a file, I need 2 write method in client & 2 read method in server.
Is this ok? Is there any other efficient way for doing this?
I think that your idea is correct. Maybe you should consider not to send files name (only the extension line .jpg) and let server generate one. This will prevent overwriting some already existing files.

Real-time HTTP stream writing console

Is there a program available that will allow me to interactively write HTTP stream data and send it to a server? Ideally I'm looking for a console app that will allow me to type or paste HTTP headers and body, send it to my server, and get the response headers and body back.
Does such a program already exist?
I'm running W7 64-bit with .NET 4.0.
if you change your mind and want a GUI app
http://code.google.com/p/rest-client/
or you can also use fiddler
Edit:
http://code.google.com/p/rest-client/ also supports commandline
Maybe telnet is an option for you? If it's not already installed on your machine, take a look at this guide from MS.
To connect to your server use it like this:
telnet www.myserver.de 80
After the connection is established, you can paste your HTTP GET reqests or what ever you like.
tinyget is a useful MSFT tool that will make simple get requests. You can store these requests in text files and stream them in.

Resources