golang-reload-browser

所属分类:Websocket编程
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2016-10-30 14:01:08
上 传 者sh-1993
说明:  实现WebSocket端点的示例应用程序,使用该端点可以以编程方式刷新浏览器选项卡。
(A sample app implementing a WebSocket endpoint with which a browser tab can be programmatically refreshed.)

文件列表:
LICENSE (1068, 2016-10-30)
build.sh (125, 2016-10-30)
main.go (343, 2016-10-30)
reload.go (3167, 2016-10-30)
reloadtest.html (1475, 2016-10-30)
vendor/ (0, 2016-10-30)
vendor/github.com/ (0, 2016-10-30)
vendor/github.com/gorilla/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/LICENSE (1312, 2016-10-30)
vendor/github.com/gorilla/websocket/client.go (11965, 2016-10-30)
vendor/github.com/gorilla/websocket/compression.go (1781, 2016-10-30)
vendor/github.com/gorilla/websocket/conn.go (26028, 2016-10-30)
vendor/github.com/gorilla/websocket/conn_read.go (380, 2016-10-30)
vendor/github.com/gorilla/websocket/conn_read_legacy.go (440, 2016-10-30)
vendor/github.com/gorilla/websocket/doc.go (6791, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/autobahn/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/autobahn/server.go (7216, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/chat/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/chat/client.go (3298, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/chat/hub.go (1148, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/chat/main.go (986, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/command/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/command/main.go (4264, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/echo/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/echo/client.go (1663, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/echo/server.go (2970, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/filewatch/ (0, 2016-10-30)
vendor/github.com/gorilla/websocket/examples/filewatch/main.go (4326, 2016-10-30)
vendor/github.com/gorilla/websocket/json.go (1373, 2016-10-30)
vendor/github.com/gorilla/websocket/mask.go (1268, 2016-10-30)
vendor/github.com/gorilla/websocket/server.go (9502, 2016-10-30)
vendor/github.com/gorilla/websocket/util.go (4854, 2016-10-30)
vendor/manifest (272, 2016-10-30)
wsClient.go (2550, 2016-10-30)
wsHub.go (970, 2016-10-30)

# 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.

近期下载者

相关文件


收藏者