Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve over torrent #1763

Open
tejt99 opened this issue Oct 21, 2019 · 3 comments
Open

Serve over torrent #1763

tejt99 opened this issue Oct 21, 2019 · 3 comments

Comments

@tejt99
Copy link

@tejt99 tejt99 commented Oct 21, 2019

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.

@Fenny

This comment has been minimized.

Copy link

@Fenny Fenny commented Oct 21, 2019

Hi @tejt99 good to hear you started learning js, welcome!

I'm not sure what you mean with

repository load over torrent

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!
})
@tejt99

This comment has been minimized.

Copy link
Author

@tejt99 tejt99 commented Oct 22, 2019

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.

@tejt99

This comment has been minimized.

Copy link
Author

@tejt99 tejt99 commented Oct 23, 2019

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.