Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upServe over torrent #1763
Open
Serve over torrent #1763
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi @tejt99 good to hear you started learning js, welcome! I'm not sure what you mean with
But you can load the whole webtorrent library on your website with cdnjs for example <script src="https://cdnjs.cloudflare.com/ajax/libs/webtorrent/0.107.16/webtorrent.min.js"></script>Or import it like this function Import(url) {
return new Promise(resolve => {
var e = document.createElement('script');
e.src = url;
e.type= 'text/javascript';
e.addEventListener('load', resolve);
document.getElementsByTagName('head')[0].appendChild(e);
})
}
Import('https://cdnjs.cloudflare.com/ajax/libs/webtorrent/0.107.16/webtorrent.min.js').then(() => {
// Webtorrent is ready!
})
|
This comment has been minimized.
This comment has been minimized.
|
What I mean is: host webtorrent.min.js and the associated files on a torrent, and load it with a small bit of js in the website. |
This comment has been minimized.
This comment has been minimized.
|
I believe it would be possible as when using instant.io, if your torrent contains a pdf or similar, it gives a preview before you download so clearly it is being cached somewhere. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I don't actually use this as I have only started learning js this week but I like looking around GitHub.
What you've done is brilliant and I'm not even sure what I'm about to suggest is possible but, could you, in theory, put a small amount of js in your website and have the rest of this repository load over torrent?
If this is stupid just say.
Thanks.