💾 Archived View for rawtext.club › ~sloum › geminilist › 002619.gmi captured on 2020-09-24 at 01:04:46. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Mr. Leveck leveck at leveck.us
Thu Sep 10 00:08:12 BST 2020
- - - - - - - - - - - - - - - - - - -
On 9/9/20 5:01 PM, Mr. Leveck wrote:
Greetings All!
My www site has for sometime been displaying a homespun gopher proxy
(IE: my website displays my gopherhole). Since I recently installed a
gemini server on my home network, I wanted to expand my proxy to gemini
too. This is complete: https://leveck.us/gemini/1436.ninja/
I am having issues, however. With the gopher proxy, I hand binary files
over to curl via php after sending the appropriate header. Curl doesn't
currently support gemini, and I have been chasing my tail on getting
images (and binary files such as my RPoD Palm OS Software Horde) to work
with my proxy.
Anyone got ideas?
Here is the networky portion of the proxy source:
28Â //Gemini Protocol Code
29Â //Nathaniel Leveck September 2020
30Â $host = $host;
31Â $port = 1965;
32Â $cert = '/var/www/cert/cert.pem';
33Â $context = stream_context_create();
34 stream_context_set_option($context, 'ssl', 'local_cert', $cert);
35Â stream_context_set_option($context, 'ssl', 'verify_peer', false);
36Â stream_context_set_option($context, 'ssl', 'verify_peer_name', false);
37Â stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
38Â $socket = stream_socket_client('ssl://'.$host.':'.$port, $error, $errorString, 2,
39Â STREAM_CLIENT_CONNECT, $context);
40Â fwrite($socket, "gemini://" . $url . "\r\n");
41Â fread($socket,8192); //disregard the status + meta
42Â $content = fread($socket,8192000); //read a suitably large number of bytes
fread, I assume, is my issue. socketread showed me no love...
The code was ill formatted. How about a retry?
-- jynx