Introducing our new CEO Don Johnson - Read More

elestio/ws-screenshot.slim

Verified Publisher

By Elestio

Updated about 1 year ago

Image
Integration & Delivery
Monitoring & Observability
Web Analytics
1

50K+

ws-screenshot

Fast websocket + rest api screenshot server  

DEMO: http://backup15.terasp.net/

Install ws-screenshot server with docker

docker pull elestio/ws-screenshot.slim

Run once

docker run -p 3000:3000 -it elestio/ws-screenshot.slim

Run as a docker service

docker run -d --restart always -p 3000:3000 -it elestio/ws-screenshot.slim

Test

Open in your browser:

http://youripaddress:3000/

Usage

REST API

Make a GET request (or open the url in your browser):

/api/screenshot?resX=1280&resY=900&outFormat=jpg&isFullPage=false&url=https://vms2.terasp.net

Websocket API

var event = { cmd: "screenshot", url: url, originalTS: (+new Date()), resX: resX, resY: resY, outFormat: outFormat, isFullPage: isFullPage };

You can check /public/js/client.js and /public/index.html for a sample on how to call the Websocket API

Supported parameters

  • url: full url to screenshot, must start with http:// or https://
  • resX: integer value for screen width, default: 1280
  • resY: integer value for screen height, default: 900
  • outFormat: output format, can be jpg, png or pdf, default: jpg
  • isFullPage: true or false, indicate if we should scroll the page and make a full page screenshot, default: false

More details on the Github repo here: https://github.com/elestio/ws-screenshot/

Docker Pull Command

docker pull elestio/ws-screenshot.slim