Gemini proxy image display

Kevin Sangeelee kevin at susa.net
Thu Sep 10 16:12:15 BST 2020


Do you mean to throw away the first 8k of content bytes?


Sent from phone

On Thu, 10 Sep 2020, 14:14 Mr. Leveck, <sysop at 1436.ninja> wrote:

> [repost in new thread]
>
> 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 (line #s from vim):
>  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...
>
> --
> jynx
> gopher://1436.ninja
> gemini://1436.ninja
> https://leveck.us
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200910/782f980e/attachment.htm>


More information about the Gemini mailing list