Kim Holviala | 29 Mar 14:23 2010
Face

[gopher] Gophernicus Server 0.4 released (renamed from kgopherd)

Everyone's dead already? Was I really gone for that long? Oh well, I'll 
just talk to myself then :-).

First of all, kgopherd is now known as Gophernicus Server. Yes, I plan 
to do a client too once I'm done with the server...

After a long hiatus I finally got back to coding and finished some of 
the things I set out to do with my gopher server. Since you all seemed 
*cough cough* a bit cautious about my gopher++ additions I decided to do 
as much as I could without any changes to the protocol. Turns out most 
of the thigs i wanted to accomplish were doable with a little hacking 
and cheating....

My first problem with the protocol was that the server didn't know the 
filetype what the client was requesting. That's pretty much solved 
without any changes to the protocol. Related to that was the problem 
where the client had no idea what kind of data the server was sending - 
that's also pretty much solved as the server now sends back whatever the 
client expects.

The next problem I had was with charsets. That's solved, kind of, but 
not properly yet. Bascially I scrapped iconv() and made my own charset 
conversion function which is input autoconfiguring and can output 
US-ASCII/Latin-1 and UTF-8. The current version only outputs US-ASCII 
which is compatible with all clients - problem solved but it could be 
better (how does the server know when to output UTF-8?).

I also wanted virtual hosting which is pretty much impossible without 
any changes to the protocol. Or so I though... with enough creative 
hacking that was _also_ solved fairly reliably. So yes, I have support 
(Continue reading)

Cameron Kaiser | 29 Mar 14:50 2010

Re: [gopher] Gophernicus Server 0.4 released (renamed from kgopherd)

> I also wanted virtual hosting which is pretty much impossible without 
> any changes to the protocol. Or so I though... with enough creative 
> hacking that was _also_ solved fairly reliably. So yes, I have support 
> for virtual hosting with plain gopher0 - compatible with all clients.

Interesting. It seems like it saves state about what it last served, or
some such? I'm trying to figure out the rules it's using (though I suppose
I could just go look at the source :-D ).

--

-- 
------------------------------------ personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckaiser@...
-- require "std_disclaimer.pl"; -----------------------------------------------
Kim Holviala | 29 Mar 17:26 2010
Face

Re: [gopher] Gophernicus Server 0.4 released (renamed from kgopherd)

On 2010-03-29 15:50, Cameron Kaiser wrote:

>> I also wanted virtual hosting which is pretty much impossible without
>> any changes to the protocol. Or so I though... with enough creative
>> hacking that was _also_ solved fairly reliably. So yes, I have support
>> for virtual hosting with plain gopher0 - compatible with all clients.
>
> Interesting. It seems like it saves state about what it last served, or
> some such?

See /server-status, that lists all the sessions it's tracking.

> I'm trying to figure out the rules it's using (though I suppose
> I could just go look at the source :-D ).

The source is VERY well commented mostly because it's the only way I'll 
be able to grok it - my memories last for about 15 minutes and then I'm 
mostly blank.

Anyway, here are the rules in order, and the last one wins (that is, 
we'll go through the whole list):

* $HOSTNAME
* -h option
* previous hostname from the session data
* whichever vhost has the file pointed by selector (using stat())
* the hostname after the semicolon in the selector

That's pretty much it, from memory. It's been more than 15 minutes since 
I looked at the code so I might be completely wrong....
(Continue reading)

Kim Holviala | 30 Mar 13:07 2010
Face

[gopher] gopher++ examples with Gophernicus/0.5-alpha

Not going to explain these too much since it's all just alpha now.... 
The first two already work, but my charset conversion function currently 
always outputs US-ASCII no matter what the settings are.

Proper virtual hosting support:
$ printf "/\t\t++\nHost: gophernicus.org\n\n" | nc holviala.com 70
$ printf "/\t\t++\nHost: holviala.com\n\n" | nc holviala.com 70

Variable-width output:
$ printf "/\t\t++\nColumns: 40\n\n" | nc holviala.com 70
$ printf "/\t\t++\nColumns: 80\n\n" | nc holviala.com 70

Different output charsets (not working yet):
$ printf "/\t\t++\nCharset: US-ASCII\n\n" | nc holviala.com 70
$ printf "/\t\t++\nCharset: UTF-8\n\n" | nc holviala.com 70

And so on...

Currently the code understands the following header lines:

* Host:             Same as in HTTP
* User-Agent:       Same as in HTTP
* Referer:          Same as in HTTP
* Filetype:         Gopher filetype of the request
* Charset:          Set output charset (not working yet)
* Columns:          Set output width

- Kim
Kim Holviala | 31 Mar 13:51 2010
Face

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

Woohoo!

Gopher++ up and running as planned. New spec not written yet... this 
time I'll do plenty of real-world code before bothering anyone with 
theories.

First of all, there's now a client with nearly full gopher++ support 
(only Referrer is missing, and I'm not sure if that's necessary)! The 
client is no other than - here comes the good part - NSCA Mosaic! I 
happend to have the sources on my ~/code/ (thanks, Cameron) so I hacked 
together a quick patch which adds gopher++ header support for it:

gopher://gophernicus.org/1/software/patches/gopher++/

The patch is *very* small, only 85 lines of which only ~33 are actual 
code changes. Which means adding support for gopher++ is _really_ simple 
to pretty much any existing gopher client.

After patching & building Mosaic the following things start working 
against the Gophernicus/0.5-alpha server running on holviala.com:

* Server knows about User-Agent and logs say it's "NCSA_Mosaic/2.7ck8"
* Server knows about the actual request filetype (no guessing)
* Server formats all menus to 74 char wide as requested by Mosaic
* Virtual hosting works without any selector;domain.com hacks
* Output charset is changed from US-ASCII to ISO-8859-1

Some examples - compare these between patched Mosaic and some other 
client like Firefox to see the difference.

(Continue reading)

Cameron Kaiser | 31 Mar 14:48 2010

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

> First of all, there's now a client with nearly full gopher++ support 
> (only Referrer is missing, and I'm not sure if that's necessary)! The 
> client is no other than - here comes the good part - NSCA Mosaic! I 
> happend to have the sources on my ~/code/ (thanks, Cameron) so I hacked 
> together a quick patch which adds gopher++ header support for it:
> 
> gopher://gophernicus.org/1/software/patches/gopher++/

Seems straightforward enough. What do other people think? It looks like it
would work okay with non-G++ servers.

--

-- 
------------------------------------ personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckaiser@...
-- All the sensitive [men] get eaten. -- "Ice Age" ----------------------------
Kim Holviala | 31 Mar 17:14 2010
Face

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

On 2010-03-31 15:48, Cameron Kaiser wrote:

>> gopher://gophernicus.org/1/software/patches/gopher++/
>
> Seems straightforward enough. What do other people think? It looks like it
> would work okay with non-G++ servers.

Before you apply the patch you might want to increase the screen width 
to 80 chars - I don't see why Mosaic wouldn't show full-width stuff.

Oh, and if you're doing a new release please rename the getline()'s 
which make compiling on Linux fail.

Both fixes are now downloadable from the gopher link above (I just added 
the linux build fix patch).

- Kim
Cameron Kaiser | 31 Mar 17:17 2010

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

> > > gopher://gophernicus.org/1/software/patches/gopher++/
> >
> > Seems straightforward enough. What do other people think? It looks like it
> > would work okay with non-G++ servers.
> 
> Before you apply the patch you might want to increase the screen width 
> to 80 chars - I don't see why Mosaic wouldn't show full-width stuff.

I just need to mess with the font selection.

> Oh, and if you're doing a new release please rename the getline()'s 
> which make compiling on Linux fail.

Yes :) however, I have other plans in mind for ck9, so that is not coming
out imminently -- for one thing, I am trying to fix the line box to be more
flexible, which lays out okay but does not make clickable areas right.

--

-- 
------------------------------------ personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckaiser@...
-- 1-GHz Pentium-III + Java + XSLT == 1-MHz 6502. -- Craig Bruce --------------
Kim Holviala | 31 Mar 18:40 2010
Face

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

On 2010-03-31 18:17, Cameron Kaiser wrote:

>> Oh, and if you're doing a new release please rename the getline()'s
>> which make compiling on Linux fail.
>
> Yes :) however, I have other plans in mind for ck9, so that is not coming
> out imminently -- for one thing, I am trying to fix the line box to be more
> flexible, which lays out okay but does not make clickable areas right.

Just wanted to say that your version of Mosaic is a really good browser 
considering it's age. I had it up and running today for hours and it 
didn't even crash :-).

- Kim
Kim Holviala | 31 Mar 21:14 2010
Face

Re: [gopher] gopher++ examples with Gophernicus/0.5-alpha

On 2010-03-31 14:51, Kim Holviala wrote:

> Gopher++ up and running as planned. New spec not written yet... this
> time I'll do plenty of real-world code before bothering anyone with
> theories.

... and the real-world testing showed that using "selector<TAB><TAB>++" 
to differentiate between gopher0 and gopher++ didn't work... It clashed 
with pygopherd's gopher+ support.

So, let's try again with "selector<TAB><TAB>GOPHER/++". New patch for 
Mosaic in the same place as the previous one:

gopher://gophernicus.org/1/software/patches/gopher++/

- Kim

Gmane