Simple HTTP server application in Go.
Running the application starts a HTTP server in port 8080 serving the contents of the current working directory. If index.html is present, root serves that. Else it serves directory listing.
-
-port port
Changes the server port
-
-root path
Changes the root directory to serve
-
-log path
Log events to a file
go get github.com/ComSecNinja/gong
go install github.com/ComSecNinja/gong
Being able to right-click and choose "Serve these files" on Windows' Explorer is handy. This is how you achieve it:
- Press
WIN+R
, type inregedit.exe
and press Enter - If you want to add this feature for all users, expand
HKEY_CLASSES_ROOT
. Else expandHKEY_CURRENT_USER
. - Navigate to
SOFTWARE\Classes\Directory
- To add the feature for right-clicking folder background
Background\shell
. If for right-clicking folder, expandshell
. - Right-click
shell
you've expanded, chooseNew > Key
and enter e.g. Serve these files. - Right click the key you created, choose
New > key
and enter command (no choice here). - Select
command
and on the right hand side right-click the(Default)
and clickModify...
- Type in the absolute path of gong.exe. It should be in
%GOPATH%/bin/gong.exe
. - If you want a different port for this function, append
-port=
and the port number you desire. - If you're in
Directory\shell
you MUST append-root=%1
for this to work properly. - After clicking
OK
you should now be able to use gong this way.