Documentation ¶
Overview ¶
Package livereload allows HTML pages to be dynamically reloaded. It includes both the server and client implementations required.
Index ¶
Constants ¶
View Source
const ( // EndpointPath is the path to the websocket endpoint EndpointPath = "/.devd.livereload" // ScriptPath is the path to the livereload JavaScript asset ScriptPath = "/.devd.livereload.js" )
Variables ¶
View Source
var Injector = inject.CopyInject{ Within: 1024 * 30, ContentType: "text/html", Marker: regexp.MustCompile(`<\/head>`), Payload: []byte(`<script src="/.devd.livereload.js"></script>`), }
Injector for the livereload script
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server implements a Livereload server
func (*Server) Reload ¶
Reload signals to connected clients that a given resource should be reloaded.
func (*Server) ServeScript ¶
func (s *Server) ServeScript(rw http.ResponseWriter, req *http.Request)
ServeScript is a handler function that serves the livereload JavaScript file
Click to show internal directories.
Click to hide internal directories.