From 66a1b1f39a1e1d5499b548b36d18c8daa872d7da Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 28 Jan 2023 14:52:35 -0700 Subject: gopher support. Some of the contrib packages were originally built gemini-specific and had to be refactored into generic core functionality and thin protocol-specific wrappers for each of gemini and gopher. --- examples/fileserver/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/fileserver') diff --git a/examples/fileserver/main.go b/examples/fileserver/main.go index e70974f..be427a1 100644 --- a/examples/fileserver/main.go +++ b/examples/fileserver/main.go @@ -26,11 +26,11 @@ func main() { // Fallthrough tries each handler in succession until it gets something other than "51 Not Found" handler := gus.FallthroughHandler( // first see if they're fetching a directory and we have /index.gmi - fs.DirectoryDefault(fileSystem, "index.gmi"), + fs.GeminiDirectoryDefault(fileSystem, "index.gmi"), // next (still if they requested a directory) build a directory listing response - fs.DirectoryListing(fileSystem, nil), + fs.GeminiDirectoryListing(fileSystem, nil), // finally, try to find a file at the request path and respond with that - fs.FileHandler(fileSystem), + fs.GeminiFileHandler(fileSystem), ) _, infoLog, _, errLog := logging.DefaultLoggers() @@ -39,7 +39,7 @@ func main() { handler = logging.LogRequests(infoLog)(handler) // run the server - server, err := gemini.NewServer(context.Background(), errLog, tlsconf, "tcp4", ":1965", handler) + server, err := gemini.NewServer(context.Background(), "localhost", "tcp4", ":1965", handler, errLog, tlsconf) if err != nil { log.Fatal(err) } -- cgit v1.2.3