MajidSas / WebRTC-file-transfer

Demonstration of using WebRTC Data Channel to send multiple files.
12 stars 5 forks source link

Upgrade Required #1

Closed upsteer closed 7 years ago

upsteer commented 7 years ago

Whenever I start the server and go to localhost:8888, it says upgrade required !!

MajidSas commented 7 years ago

Thank you for your interest.

This is because you are trying to access the server through the browser. There are no HTML files here.

After running the server, just open the file index.html in a browser window and it will work. I'll update the README to make it more clearer.

Let me know if you get it to work.

upsteer commented 7 years ago

I did all the things you said, but the Your code is blank !!

MajidSas commented 7 years ago

It works for me. I'll create a short video for you later today to show you the steps. In the meantime, can you give me more details (e.g. Node.js version, operating system, browser, etc.).

I'm using: Node.js v6.10.0 WebSocket v2.2.0 Chrome v57 Firefox v51

Can you post the output of the following commands:

node --version

npm ls

Also, when you start the server, can you post the output for that?

For me it is something similar to this:

Server started... User logged in as A2J3J User logged in as YD276 User logged in as SW0NL Sending offer to SW0NL Sending candidate to SW0NL Sending answer to A2J3J Sending candidate to A2J3J Sending candidate to A2J3J

upsteer commented 7 years ago

upsteer@machine:~$ node --version v5.0.0 upsteer@machine:~/WebRTC-file-transfer$ npm ls /home/upsteer ├─┬ express@4.15.2 │ ├─┬ accepts@1.3.3 │ │ ├─┬ mime-types@2.1.14 │ │ │ └── mime-db@1.26.0 │ │ └── negotiator@0.6.1 │ ├── array-flatten@1.1.1 │ ├── content-disposition@0.5.2 │ ├── content-type@1.0.2 │ ├── cookie@0.3.1 │ ├── cookie-signature@1.0.6 │ ├─┬ debug@2.6.1 │ │ └── ms@0.7.2 │ ├── depd@1.1.0 │ ├── encodeurl@1.0.1 │ ├── escape-html@1.0.3 │ ├── etag@1.8.0 │ ├─┬ finalhandler@1.0.0 │ │ ├─┬ debug@2.6.1 │ │ │ └── ms@0.7.2 │ │ └── unpipe@1.0.0 │ ├── fresh@0.5.0 │ ├── merge-descriptors@1.0.1 │ ├── methods@1.1.2 │ ├─┬ on-finished@2.3.0 │ │ └── ee-first@1.1.1 │ ├── parseurl@1.3.1 │ ├── path-to-regexp@0.1.7 │ ├─┬ proxy-addr@1.1.3 │ │ ├── forwarded@0.1.0 │ │ └── ipaddr.js@1.2.0 │ ├── qs@6.4.0 │ ├── range-parser@1.2.0 │ ├─┬ send@0.15.1 │ │ ├── debug@2.6.1 │ │ ├── destroy@1.0.4 │ │ ├─┬ http-errors@1.6.1 │ │ │ └── inherits@2.0.3 │ │ ├── mime@1.3.4 │ │ └── ms@0.7.2 │ ├── serve-static@1.12.1 │ ├── setprototypeof@1.0.3 │ ├── statuses@1.3.1 │ ├─┬ type-is@1.6.14 │ │ └── media-typer@0.3.0 │ ├── utils-merge@1.0.0 │ └── vary@1.1.0 ├─┬ serverless-webrtc@1.0.5 │ ├── ansi@0.3.0 │ └─┬ wrtc@0.0.61 │ ├─┬ download@5.0.3 │ │ ├─┬ caw@2.0.0 │ │ │ ├── get-proxy@1.1.0 │ │ │ └── tunnel-agent@0.4.3 │ │ ├─┬ decompress@4.0.0 │ │ │ ├─┬ decompress-tar@4.1.0 │ │ │ │ └── file-type@3.9.0 │ │ │ ├─┬ decompress-tarbz2@4.1.0 │ │ │ │ ├─┬ seek-bzip@1.0.5 │ │ │ │ │ └─┬ commander@2.8.1 │ │ │ │ │ └── graceful-readlink@1.0.1 │ │ │ │ └─┬ unbzip2-stream@1.0.10 │ │ │ │ ├─┬ buffer@3.6.0 │ │ │ │ │ ├── base64-js@0.0.8 │ │ │ │ │ └── ieee754@1.1.8 │ │ │ │ └── through@2.3.8 │ │ │ ├── decompress-targz@4.0.0 │ │ │ ├─┬ decompress-unzip@4.0.1 │ │ │ │ ├─┬ get-stream@2.3.1 │ │ │ │ │ └─┬ pinkie-promise@2.0.1 │ │ │ │ │ └── pinkie@2.0.4 │ │ │ │ └─┬ yauzl@2.7.0 │ │ │ │ ├── buffer-crc32@0.2.13 │ │ │ │ └─┬ fd-slicer@1.0.1 │ │ │ │ └── pend@1.2.0 │ │ │ └─┬ strip-dirs@1.1.1 │ │ │ ├─┬ chalk@1.1.3 │ │ │ │ ├── ansi-styles@2.2.1 │ │ │ │ ├── has-ansi@2.0.0 │ │ │ │ └── supports-color@2.0.0 │ │ │ ├── get-stdin@4.0.1 │ │ │ ├─┬ is-absolute@0.1.7 │ │ │ │ └── is-relative@0.1.3 │ │ │ ├── is-natural-number@2.1.1 │ │ │ └── sum-up@1.0.3 │ │ ├─┬ filenamify@2.0.0 │ │ │ ├── filename-reserved-regex@2.0.0 │ │ │ ├─┬ strip-outer@1.0.0 │ │ │ │ └── escape-string-regexp@1.0.5 │ │ │ └── trim-repeated@1.0.0 │ │ ├── get-stream@3.0.0 │ │ ├─┬ got@6.7.1 │ │ │ ├─┬ create-error-class@3.0.2 │ │ │ │ └── capture-stack-trace@1.0.0 │ │ │ ├── duplexer3@0.1.4 │ │ │ ├── is-redirect@1.0.0 │ │ │ ├── is-retry-allowed@1.1.0 │ │ │ ├── is-stream@1.1.0 │ │ │ ├── lowercase-keys@1.0.0 │ │ │ ├── safe-buffer@5.0.1 │ │ │ ├── timed-out@4.0.1 │ │ │ ├── unzip-response@2.0.1 │ │ │ └─┬ url-parse-lax@1.0.0 │ │ │ └── prepend-http@1.0.4 │ │ ├─┬ mkdirp@0.5.1 │ │ │ └── minimist@0.0.8 │ │ └── pify@2.3.0 │ ├─┬ gunzip-maybe@1.4.0 │ │ ├─┬ browserify-zlib@0.1.4 │ │ │ └── pako@0.2.9 │ │ ├── is-deflate@1.0.0 │ │ ├── is-gzip@1.0.0 │ │ ├─┬ peek-stream@1.1.1 │ │ │ ├─┬ duplexify@3.5.0 │ │ │ │ ├── end-of-stream@1.0.0 │ │ │ │ └── stream-shift@1.0.0 │ │ │ └─┬ through2@0.5.1 │ │ │ ├─┬ readable-stream@1.0.34 │ │ │ │ └── isarray@0.0.1 │ │ │ └── xtend@3.0.0 │ │ ├── pumpify@1.3.5 │ │ └─┬ through2@2.0.3 │ │ ├─┬ readable-stream@2.2.3 │ │ │ ├── buffer-shims@1.0.0 │ │ │ ├── core-util-is@1.0.2 │ │ │ ├── isarray@1.0.0 │ │ │ ├── process-nextick-args@1.0.7 │ │ │ ├── string_decoder@0.10.31 │ │ │ └── util-deprecate@1.0.2 │ │ └── xtend@4.0.1 │ ├── nan@2.5.1 │ ├─┬ node-pre-gyp@0.6.33 │ │ ├─┬ nopt@3.0.6 │ │ │ └── abbrev@1.1.0 │ │ ├─┬ npmlog@4.0.2 │ │ │ ├─┬ are-we-there-yet@1.1.2 │ │ │ │ └── delegates@1.0.0 │ │ │ ├── console-control-strings@1.1.0 │ │ │ ├─┬ gauge@2.7.3 │ │ │ │ ├── aproba@1.1.1 │ │ │ │ ├── has-unicode@2.0.1 │ │ │ │ ├── object-assign@4.1.1 │ │ │ │ ├── signal-exit@3.0.2 │ │ │ │ ├─┬ string-width@1.0.2 │ │ │ │ │ ├── code-point-at@1.1.0 │ │ │ │ │ └─┬ is-fullwidth-code-point@1.0.0 │ │ │ │ │ └── number-is-nan@1.0.1 │ │ │ │ ├─┬ strip-ansi@3.0.1 │ │ │ │ │ └── ansi-regex@2.1.1 │ │ │ │ └── wide-align@1.1.0 │ │ │ └── set-blocking@2.0.0 │ │ ├─┬ rc@1.1.7 │ │ │ ├── deep-extend@0.4.1 │ │ │ ├── ini@1.3.4 │ │ │ ├── minimist@1.2.0 │ │ │ └── strip-json-comments@2.0.1 │ │ ├─┬ request@2.81.0 │ │ │ ├── aws-sign2@0.6.0 │ │ │ ├── aws4@1.6.0 │ │ │ ├── caseless@0.12.0 │ │ │ ├─┬ combined-stream@1.0.5 │ │ │ │ └── delayed-stream@1.0.0 │ │ │ ├── extend@3.0.0 │ │ │ ├── forever-agent@0.6.1 │ │ │ ├─┬ form-data@2.1.2 │ │ │ │ └── asynckit@0.4.0 │ │ │ ├─┬ har-validator@4.2.1 │ │ │ │ ├─┬ ajv@4.11.5 │ │ │ │ │ ├── co@4.6.0 │ │ │ │ │ └─┬ json-stable-stringify@1.0.1 │ │ │ │ │ └── jsonify@0.0.0 │ │ │ │ └── har-schema@1.0.5 │ │ │ ├─┬ hawk@3.1.3 │ │ │ │ ├── boom@2.10.1 │ │ │ │ ├── cryptiles@2.0.5 │ │ │ │ ├── hoek@2.16.3 │ │ │ │ └── sntp@1.0.9 │ │ │ ├─┬ http-signature@1.1.1 │ │ │ │ ├── assert-plus@0.2.0 │ │ │ │ ├─┬ jsprim@1.3.1 │ │ │ │ │ ├── extsprintf@1.0.2 │ │ │ │ │ ├── json-schema@0.2.3 │ │ │ │ │ └── verror@1.3.6 │ │ │ │ └─┬ sshpk@1.11.0 │ │ │ │ ├── asn1@0.2.3 │ │ │ │ ├── assert-plus@1.0.0 │ │ │ │ ├── bcrypt-pbkdf@1.0.1 │ │ │ │ ├─┬ dashdash@1.14.1 │ │ │ │ │ └── assert-plus@1.0.0 │ │ │ │ ├── ecc-jsbn@0.1.1 │ │ │ │ ├─┬ getpass@0.1.6 │ │ │ │ │ └── assert-plus@1.0.0 │ │ │ │ ├── jodid25519@1.0.2 │ │ │ │ ├── jsbn@0.1.1 │ │ │ │ └── tweetnacl@0.14.5 │ │ │ ├── is-typedarray@1.0.0 │ │ │ ├── isstream@0.1.2 │ │ │ ├── json-stringify-safe@5.0.1 │ │ │ ├── oauth-sign@0.8.2 │ │ │ ├── performance-now@0.2.0 │ │ │ ├── stringstream@0.0.5 │ │ │ ├─┬ tough-cookie@2.3.2 │ │ │ │ └── punycode@1.4.1 │ │ │ ├── tunnel-agent@0.6.0 │ │ │ └── uuid@3.0.1 │ │ ├─┬ rimraf@2.5.4 │ │ │ └─┬ glob@7.1.1 │ │ │ ├── fs.realpath@1.0.0 │ │ │ ├── inflight@1.0.6 │ │ │ ├─┬ minimatch@3.0.3 │ │ │ │ └─┬ brace-expansion@1.1.6 │ │ │ │ ├── balanced-match@0.4.2 │ │ │ │ └── concat-map@0.0.1 │ │ │ └── path-is-absolute@1.0.1 │ │ ├── semver@5.3.0 │ │ ├─┬ tar@2.2.1 │ │ │ ├── block-stream@0.0.9 │ │ │ └─┬ fstream@1.0.11 │ │ │ └── graceful-fs@4.1.11 │ │ └─┬ tar-pack@3.3.0 │ │ ├── fstream-ignore@1.0.5 │ │ ├─┬ once@1.3.3 │ │ │ └── wrappy@1.0.2 │ │ ├── readable-stream@2.1.5 │ │ └── uid-number@0.0.6 │ └─┬ tar-fs@1.15.1 │ ├── chownr@1.0.1 │ ├─┬ pump@1.0.2 │ │ └── end-of-stream@1.2.0 │ └─┬ tar-stream@1.5.2 │ └── bl@1.2.0 ├─┬ socket.io@1.7.3 │ ├─┬ debug@2.3.3 │ │ └── ms@0.7.2 │ ├─┬ engine.io@1.8.3 │ │ ├── base64id@1.0.0 │ │ ├─┬ debug@2.3.3 │ │ │ └── ms@0.7.2 │ │ ├─┬ engine.io-parser@1.3.2 │ │ │ ├── after@0.8.2 │ │ │ ├── arraybuffer.slice@0.0.6 │ │ │ ├── base64-arraybuffer@0.1.5 │ │ │ ├── blob@0.0.4 │ │ │ └── wtf-8@1.0.0 │ │ └─┬ ws@1.1.2 │ │ ├── options@0.0.6 │ │ └── ultron@1.0.2 │ ├─┬ has-binary@0.1.7 │ │ └── isarray@0.0.1 │ ├── object-assign@4.1.0 │ ├─┬ socket.io-adapter@0.5.0 │ │ └─┬ debug@2.3.3 │ │ └── ms@0.7.2 │ ├─┬ socket.io-client@1.7.3 │ │ ├── backo2@1.0.2 │ │ ├── component-bind@1.0.0 │ │ ├── component-emitter@1.2.1 │ │ ├─┬ debug@2.3.3 │ │ │ └── ms@0.7.2 │ │ ├─┬ engine.io-client@1.8.3 │ │ │ ├── component-emitter@1.2.1 │ │ │ ├── component-inherit@0.0.3 │ │ │ ├─┬ debug@2.3.3 │ │ │ │ └── ms@0.7.2 │ │ │ ├── has-cors@1.1.0 │ │ │ ├── parsejson@0.0.3 │ │ │ ├── parseqs@0.0.5 │ │ │ ├─┬ ws@1.1.2 │ │ │ │ └── ultron@1.0.2 │ │ │ ├── xmlhttprequest-ssl@1.5.3 │ │ │ └── yeast@0.1.2 │ │ ├── indexof@0.0.1 │ │ ├── object-component@0.0.3 │ │ ├─┬ parseuri@0.0.5 │ │ │ └─┬ better-assert@1.0.2 │ │ │ └── callsite@1.0.0 │ │ └── to-array@0.1.4 │ └─┬ socket.io-parser@2.3.1 │ ├── component-emitter@1.1.2 │ ├─┬ debug@2.2.0 │ │ └── ms@0.7.1 │ ├── isarray@0.0.1 │ └── json3@3.3.2 └─┬ ws@2.2.0 └── ultron@1.1.0

Firefox 52.0 Ubuntu 16.04

After I start the server, it just says: Server started...

Thanks in advance :)

MajidSas commented 7 years ago

The server seems to be working, but the clients are not connecting to it. When you open this file in the browser: WebRTC-file-transfer-master/index.html Can you post the console output? In Chrome, you can press CTRL+SHIFT+J In Firefox, CTRL+SHIFT+I

It is possible that the file client.js is not configured correctly. Also you can access the static files through an HTTP server instead of directly through the file system.

You can install this:

sudo npm install http-server -g

Then move to the main folder (WebRTC-file-transfer-master) and run this command:

http-server

You can then access the application through the IP it shows you, the default is:

https://localhost:8080

upsteer commented 7 years ago

A very big thanks to you, sir !!