Skip to content

Commit

Permalink
Various minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiesey committed Dec 12, 2015
1 parent 5d9cab3 commit 9c006bd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ since that wouldn't open the homepage as well. This can be fixed once Chrome imp
serviceworkers, so if you want to see this fixed, you should
[star this issue on the chromium bug tracker](https://code.google.com/p/chromium/issues/detail?id=302019).

* Service workers only work over https (except on localhost), so if you want to set up a mirror you
MUST get an SSL certificate and configure your server properly.

* This is still very experimental! If you think you can help make it better, please send me a pull
request.

Expand Down
2 changes: 1 addition & 1 deletion client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function loadPage (loc) {
var matches = MATCH_PATH.exec(loc)
if (matches) {
var hash = matches[1]
var path = matches[2] || 'index.html'
var path = matches[2] || ''
var a = document.createElement('a')
a.target = '_blank'
a.href = '/sandbox/' + hash + '/' + path
Expand Down
9 changes: 8 additions & 1 deletion css/main.styl
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@

#location
width: 30%
width: 20%

.header
font-family: sans-serif

.footer
font-size: smaller
26 changes: 18 additions & 8 deletions server/views/index.jade
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
extends layout

block body
#main-content
p
| Open a site:
input#location(type='text', value='e11f7561db351920099f65324dfe77275bd6e5db')
input#go-button(type='button', value='Go!', disabled)
P
| Leave this page open while browsing!
script(src='/bundle.js')
h1.header
| PeerCloud: The Serverless Web
#main-content
p.
Paste a site infohash below to open a specific site, or leave the default to
open an example image gallery. Please #[strong be patient] since it may take a
while for the site to appear.
form
input#location(type='text', value='e11f7561db351920099f65324dfe77275bd6e5db')
input#go-button(type='submit', value='Go!', disabled)
p.
You #[strong must] leave this page open while browsing! This is because Chrome
doesn't support WebRTC from service workers. There is
#[a(href='https://code.google.com/p/chromium/issues/detail?id=302019') a bug]
open about this on the chromium bug tracker.
p.footer
| Code available #[a(href='https://github.com/jhiesey/peercloud') on GitHub]
script(src='/bundle.js')
3 changes: 1 addition & 2 deletions static/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var FILES = [
'bundle.js',
'main.css',
'service-worker.js',
'fakecookie.js',
''
]

Expand Down Expand Up @@ -40,7 +39,7 @@ self.addEventListener('fetch', function (event) {
if (event.request.method === 'GET') {
if (matches) {
var hash = matches[1]
var path = matches[2]
var path = matches[2] || 'index.html'
event.respondWith(new Promise(function (resolve, reject) {
fetchFromTorrent(hash, path, function (err, response) {
if (err) {
Expand Down

0 comments on commit 9c006bd

Please sign in to comment.