golang-reload-browser

command module
v0.0.0-...-1d5c077 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2016 License: MIT Imports: 8 Imported by: 0

README

Golang page reloader

This is a small sample application implemented in Golang which can programmatically refresh a tab in a browser. It is accompanying a blog post I've written about the subject with all the details: .

It hosts a small WebSocket service with a single reload endpoint, to which we can connect from the browser, and send a message every time we want it to be reloaded.

Usage

First, compile the application by running the script build.sh, it'll put the output in the file bin/reload.

./build.sh

Then start up the application.

bin/reload

Then open the static file reloadtest.html in the browser.

Every time we press Enter in the terminal, the page should display a message. If we uncomment the location.reload() call, then instead of printing a message, the tab will be refreshed.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL