Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: once and done #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jceaser
Copy link

@jceaser jceaser commented Feb 4, 2024

  1. Adding a way to make one request and return the response to the console so that the tool can be used as a CGI handler on simple web hosting shell accounts. To use pass a request to the flag -once like this: -once /README.md
  2. Exposing a setting for configuring the gopher document root. To use pass -root <path> when launching
  3. Changing port to a number to enforce more accurate values are used
  4. Adding a script to document things, sample content, a wrapper CGI script.

@jceaser
Copy link
Author

jceaser commented Feb 4, 2024

An example of this work can be seen at http://thomascherry.name/cgi-bin/gwrap.cgi?/. My web service does not let me host anything on port 70, so I'm stuck on the web. Not knowing much, this is my attempt to get your app to run as a web application, but returning gopher content. Bombadillo will not handle it as of yet, but I have been playing with its code as well. I may just write a new client which makes HTTP calls but expects gopher content. Any ideas are welcome.

These changes should be pretty independent of my global plans to create a gopher server on the web. It's just nice for testing to be able to call one request and get a response, so I hope you find it helpful.

@jceaser jceaser closed this Feb 4, 2024
@jceaser jceaser reopened this Feb 4, 2024
scripts/gwrap.cgi Outdated Show resolved Hide resolved
run.sh Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@@ -13,6 +13,26 @@ protocol written in [Go](http://golang.org/) initially based on [gogopherd](http

go get -u github.com/peterhellberg/gopher/cmd/gopherd

## Compile

go build -o gopher.local.native cmd/gopherd/main.go
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a Compile section, the Installation section should be updated to use go install github.com/peterhellberg/gopher/cmd/gopherd@latest instead of go get -u github.com/peterhellberg/gopher/cmd/gopherd

Copy link
Author

@jceaser jceaser Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I don't want to install at this point, I want a local compile. The primary reason is that I can't compile go on my web server (a hosted service I pay for but have little control over), so I am only interested in generating a binary that I can scp up. Installing would put the files in ~/go right? I don't mind documenting an install command.

Also, can you name a binary when you install? golang/go#44469

## Usage
For a standalone server use the following command to run the server on the localhost under port 7070.

./gopher.local.native \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the binary should be gopherd

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you object to the longer names for the cross compiled versions?

@peterhellberg
Copy link
Owner

Thank you for opening the PR, I've left a few comments as I'm a bit reluctant to bring in all of the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants