Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jwatson-CO-edu/httpcanvas

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jwatson-CO-edu/httpcanvas

  • v0.0.0-20210120224105-90b42c1f19ed
  • Source
  • Go
  • Socket score

Version published
Created
Source

httpcanvas

write to an html5 canvas using go

The app function starts once a we browser connects to http://host:port/

That request downloads a bit of html and javascript to connect to the server and run commands

Further GET requests causes the output to move to the most recent request.

Example

package main

import (
    "github.com/kbatten/httpcanvas"
    "math"
    "time"
)

func app(context *httpcanvas.Context) {
    centerX := context.Width / 2
    centerY := context.Height / 2

    context.BeginPath()
    context.Arc(centerX, centerY, 70, 0, 2*math.Pi, false)
    context.FillStyle("green")
    context.Fill()

    time.Sleep(5 * time.Second)

    context.LineWidth(5)
    context.StrokeStyle("#003300")
    context.Stroke()
    
    context.ShowFrame()
}

func main() {
    httpcanvas.ListenAndServe(":8080", app)
}

FAQs

Package last updated on 20 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc