StreamSaver.js
StreamSaver.js copied to clipboard
Any instruction on how to self host mitm?
I use this package in an angular project, everything works fine in dev env.
I need to deploy to a production environment isolated from the Internet, the production environment cannot access github.io
I am new to javascript, and i have tried to clone the code and self host the mitm.html with a local python https server.
from http.server import HTTPServer, BaseHTTPRequestHandler
import ssl
httpd = HTTPServer(('localhost', 4443), BaseHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket,
keyfile="path/to/key.pem",
certfile='path/to/cert.pem', server_side=True)
httpd.serve_forever()
after exec the python script, i can open the https://localhost:4443/mitm.html in browser.
I also config the streamSaver.mitm='https://localhost:4443/mitm.html'. But when i try to write the fetch stream to disk, nothing happened.
Any help or instruction about self host mitm?
You need to copy over /mitm.html and /sw.js into your public folder and assign streamSaver.mitm = '/mitm.html'
You are most likely getting an error that sw.js is not loading.
If you are using a Python server locally aioquic
and WebTransport
can be used to stream content to local file system.
The default mitm.html
is not safe to use in Firefox. Maybe this should be documented better.
Would you like to submit a PR?
Would you like to submit a PR?
OK, I'll give a try.
I would like to reopen this conversation to ask if it's possible to bundle the 'mitm.html' file instead of accessing it through a URL.
I'm creating a library using StreamSaver and would like to store the 'mitm.html' file in my assets in order to load it in the library.
streamsaver.mitm = './assets/mitm.html
or
streamsaver.mitm = 'file://assets/mitm.html
Any idea if this is possible? Thanks