WIP: Connect to unix sockets to interface with user-written programs. #11

Draft
qcna wants to merge 2 commits from qcna/vger:master into master
First-time contributor

This patch fixes the potentially unwanted behavior of responding to unix socket requests like a file just vanished half-way through the request.

Additionally, it introduces the ability to connect to said sockets and stream data from them to the requester, through gemini. This is useful because it makes an extremely easy way for tilde members to programmatically create responses without having to deal with CGI. They can just create a program that listens on a socket inside the server root.

For example: (nmap-style ncat)

ncat -Ulk date.gmi -e /usr/bin/date

Now, a user requesting date.gmi with a gemini client will get the following text/gemini response: Fri Mar 10 06:29:14 PM CET 2023

Please note that I am not very experienced with C. I was quite careful while writing it, but there is a decent chance I made some big mistake somewhere. A thorough review would be most appreciated :)

This patch fixes the potentially unwanted behavior of responding to unix socket requests like a file just vanished half-way through the request. Additionally, it introduces the ability to connect to said sockets and stream data from them to the requester, through gemini. This is useful because it makes an extremely easy way for tilde members to programmatically create responses without having to deal with CGI. They can just create a program that listens on a socket inside the server root. For example: (nmap-style ncat) ```sh ncat -Ulk date.gmi -e /usr/bin/date ``` Now, a user requesting `date.gmi` with a gemini client will get the following text/gemini response: `Fri Mar 10 06:29:14 PM CET 2023` Please note that I am not very experienced with C. I was quite careful while writing it, but there is a decent chance I made some big mistake somewhere. A thorough review would be most appreciated :)
qcna added 2 commits 2023-03-10 17:30:34 +00:00
This pull request is marked as a work in progress.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b qcna-master master
git pull master

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff qcna-master
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: solene/vger#11
No description provided.