Skip to content

Tags: baijum/webtail

Tags

step11

Toggle step11's commit message
parse http address given through command line

step10

Toggle step10's commit message
use flag package for command line argument parsing

step09

Toggle step09's commit message
read standard input

step08

Toggle step08's commit message
show the data in the page itself

step07

Toggle step07's commit message
read one file with bufio

step06

Toggle step06's commit message
template variables

step05

Toggle step05's commit message
Use template

step04

Toggle step04's commit message
write more messages on a time interval

step03

Toggle step03's commit message
write message asynchronously using goroutine

Created a separate function to be used as a goroutine.

step02

Toggle step02's commit message
Receive messages through websocket and display

- Client side HTML & JavaScript to receive a `hello` message

- In the client JavaScript, WebSocket connection object is
  created and an event handler is registered for `onmessage`
  event.  The handler fuction write the message to the
  console (To see the message, open the console in debug window).

- In the server, HTTP handler write a `hello` message to websocket.
  Normal HTTP request is upgraded to websocket using the
  Gorilla websocket package.

- URL origin check is disabled.  This is required as the HTML is
  not served from the same URL origin.  This can be changed later.