/CanvasStreamTest

Example of sending server drawn canvases to a browser

Primary LanguageGoGNU General Public License v2.0GPL-2.0

CanvasStreamTest

After reading Intro to (images in) Go by @pheelicks I started thinking about a better approach to stream the canvas to the browser. Using data URIs, this is quite simple. I hammered together the Nodes example with my approach as a showcase. I don't use base64 data URIs anymore because it adds a lot of overhead. Instead I serve the image in a 2nd handler and just update the img.src attribute with a unused parameter so the browser dosn't cache it.