GithubHelp home page GithubHelp logo

nodesock's Introduction

#Introduction A simple file sharing program written in node

#Usage

  1. First run the server node server.js
  2. Now, the client has two modes
  • Interactive mode: node client.js
  • Bulk Uploader: node client.js <json_file>

#Dependencies

  • Node
  • sqlite3

#Design Decisions

  • Multiple Clients: Nodejs has been specifically used because of this reason, since nodejs handles everything asynchronously in an event loop, it has the ideal environment for a network application.

  • Multiple Requests: Each connection to the server serves as a closure; in essence, every connection is handled independent of other clients. Each request is handled inside this connection object.

  • Database: sqlite has been used for the database as it does not need additional installations and only requires a node module. A simple file can serve as a sqlite database.

  • Filepath: Filepaths are resolved before sending them to the server, invalid paths are signalled as an error.

  • P2P: Every client has a listener at FILEPORT, whenever it recieves a request to share a file, it sends the entire file to peer asking for it.

  • Command Structure: <COMMAND>;;parameter1;;parameter2..

  • ;; has been chosen as the delimiter arbitarily

  • <NEWUSER>

  • <OLDUSER>

  • <SEARCH>

  • <UPLOAD>

  • <RESULTS>

  • <UPLOADED>

  • <REGISTERED>

#Limitations

  • All p2p transferred files are written to a single file called recieved. Which is overwritten every time.

nodesock's People

Contributors

srijanshetty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.