GithubHelp home page GithubHelp logo

vivainio / adhocpush Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 732 KB

Web service to push messages (e.g. json) to all registered peers, and get replies (e.g. "list files on mmc card", "install this package", "wipe disk" etc)

CoffeeScript 64.88% JavaScript 5.02% Python 30.10%

adhocpush's Introduction

Ad hoc push

Typical problem: you have a phone with network connection set up. You don't want to hassle with bluetooth or USB (or,g asp. IR). You just want to browse the device file system, copy over some files, open url's in browser, etc.

Adhocpush works by creating a small p2p network (think of it as "chatroom") by password alone. You install adhocpush app on your phone and specify a password. You specify the same password on web interface to send commands.

First implementation for the phone client will be for Nokia Asha phones. They will connect to the web service by long polling or interval polling. The phone application will be responsible for understanding the messages coming from the web service, and implementing relevant functionality.

Phone application will support "plugins" so that you can easily add new message types.

Suggested format is json like this:

{
	'_type' : 'pushfiles',
	'data' : {
		files: []
	}
}

Central dispatcher would look at _type and give it to the plugin registered to handle that type. The rest is up to the plugin.

Current state: no code has been written yet.

Suggested tooling: Node & express.js for the web interface, Java for the client end.

What follows is a spec for packages that we can handle.

All commands MUST contain: _type and args.

All command CAN contain: "request_cookie" and client_id.

In case of no client_id, all connected devices (that feel like it) can respond.

Launch url

Opens url in the browser

{
	'_type': 'launch_url',
	'client': "asha_311_rd",
	'args' : {
		'url' : 'http://google.com'
	}
}

Reply: none

List files

{
	_type : 'find_files',
	request_cookie: "decafbad",
	args : {
		rootdir : "c:/",

	}
}

Reply:

{
	_type: 'find_files_reply',
	reply_cookie: "decafbad",
	args : {
		files: [{name: "c:/a.txt"}, ...]
	}
}

Request download

Download urls from internet to file system

{
	_type: 'download_files',
	args: {
		files: {
			url: "http://download.pics.com/lolcat.png",
			targetdir: "c:/lolcat.png"
		}
	}
	
}

Request upload

Ask phone to upload files to the service

{
	_type: "upload_files",
	request_cookie: "decafbad"
	args: {
		files: ["c:/lolcat.png"]

	}
}

Reply

{
	_type: "upload_files_reply",
	request_cookie: "decafbad",
	args: {
		uploaded: [
			{
				file: 'c:/lolcat.png',
				to: "http://upload.com/lolcat.png"
			 }]

	}
}

adhocpush's People

Contributors

jnynas avatar vivainio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

adhocpush's Issues

List files on file system

INPUT: directory, or location otherwise (SD card...)

Push list of files from phones to the web interface, shows all the entries on web interface. Ability to click on entries to fetch/view actual file

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.