├── README.md ├── e2ee_screen_share ├── e2ee_video_player.html ├── index.html └── sw.js ├── file_upload_progress.html ├── file_upload_progress_with_transformstream.html ├── gzip_inifinite_stream.html ├── infinite_text_stream.html ├── screen_share.html ├── screen_share_with_filter.html ├── simple_phone.html ├── support_check.html ├── support_check_with_piping_server.html ├── text_stream.html ├── text_stream_with_text_encoder_stream.html ├── video_chat.html ├── video_player.html └── zip_file_transfer └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # piping-server-streaming-upload 2 | 3 | `fetch()`'s streaming upload feature over [Piping Server](https://github.com/nwtgck/piping-server) 4 | 5 | ## Usage 6 | 7 | ```bash 8 | cd 9 | python3 -m http.server 10 | ``` 11 | 12 | Then, go to . 13 | Note that, currently, Google Chrome Canary and Dev are supported with `enable-experimental-web-platform-features` flag. 14 | -------------------------------------------------------------------------------- /e2ee_screen_share/e2ee_video_player.html: -------------------------------------------------------------------------------- 1 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /e2ee_screen_share/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 45 | -------------------------------------------------------------------------------- /e2ee_screen_share/sw.js: -------------------------------------------------------------------------------- 1 | importScripts("https://cdnjs.cloudflare.com/ajax/libs/openpgp/4.10.7/compat/openpgp.min.js"); 2 | 3 | const password = "my secret password"; 4 | 5 | self.addEventListener('fetch', (event) => { 6 | const url = new URL(event.request.url); 7 | if (url.pathname === '/e2ee_screen_share/swvideo') { 8 | const path = url.hash.substring(1); 9 | event.respondWith((async () => { 10 | const res = await fetch(`https://ppng.io/${path}`); 11 | // Allow unauthenticated stream 12 | // (see: https://github.com/openpgpjs/openpgpjs/releases/tag/v4.0.0) 13 | openpgp.config.allow_unauthenticated_stream = true; 14 | // Decrypt 15 | const rawStream = await (async () => { 16 | const plaintext = await openpgp.decrypt({ 17 | message: await openpgp.message.read(res.body), 18 | passwords: [password], 19 | format: 'binary' 20 | }); 21 | return plaintext.data; 22 | })(); 23 | 24 | return new Response(rawStream); 25 | })()); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /file_upload_progress.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 45 | -------------------------------------------------------------------------------- /file_upload_progress_with_transformstream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 39 | -------------------------------------------------------------------------------- /gzip_inifinite_stream.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /infinite_text_stream.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /screen_share.html: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /screen_share_with_filter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 60 | -------------------------------------------------------------------------------- /simple_phone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 45 | -------------------------------------------------------------------------------- /support_check.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /support_check_with_piping_server.html: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /text_stream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 23 | -------------------------------------------------------------------------------- /text_stream_with_text_encoder_stream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /video_chat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 45 | -------------------------------------------------------------------------------- /video_player.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zip_file_transfer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 86 | --------------------------------------------------------------------------------