mirror of
https://github.com/rclone/rclone.git
synced 2024-12-11 09:41:47 +01:00
1dbdc48a77
The BSD-style license that Go uses requires the license to be included with the source distribution; so add it as LICENSE.wasmexec (to avoid confusion with the other licenses in rclone) and note the location of the license in wasm_exec.js itself. |
||
---|---|---|
.. | ||
.gitignore | ||
index.html | ||
LICENSE.wasmexec | ||
loader.js | ||
main.go | ||
Makefile | ||
README.md | ||
serve.go | ||
wasm_exec.js |
Rclone as WASM
This directory contains files to use the rclone rc as a library in the browser.
This works by compiling rclone to WASM and loading that in via javascript.
This contains the following files
index.html
- test web page to load the moduleloader.js
- java script to load the module - see here for usagemain.go
- main go code exporting the rclone rcMakefile
- test makefileREADME.md
- this readmeserve.go
- test program to serve the web pagewasm_exec.js
- interface code from the go source - don't edit
Compiling
This can be compiled by using make
or alternatively GOARCH=wasm GOOS=js go build -o rclone.wasm
Running
Run the test server with make serve
and examine the page at
http://localhost:3000/ - look at the javascript console and look at
the end of loader.js
for how that works.