-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently tailsrv allows input in a form of a seek location. I would like to add a special case. Allow tailsrv to accept userdata as the first thing on the socket which would then send a user-defined blob followed by a newline. Or an u64 followed by bytes of data. Whatever works.
So for a real example, I might start tailsrv like
tailsrv ... /tmp/foo/bar --userdata '{ "filename": "bar" }'This lets me communicate to the client (on demand) that it's streaming bar and the client can then for example save the file locally with the same name. metadata is arbitrary bytes.
I could then send userdata/n0/n to tailsrv to get the user data followed by the actual data stream and I can happily use the information to, for example, replicate to the same filename, or whatever I want.
This allows to pass through information on the same connection instead of requiring a side-channel to pass through data which is a hassle to set up and race-y and error prone or requires format changes to underlying data stream to smuggle the data and so on.