Gemini => HTTP Proxy image choking

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


More information about the Gemini mailing list