Giter Site home page Giter Site logo

uwnetworkslab / uproxy-p2p Goto Github PK

View Code? Open in Web Editor NEW
857.0 108.0 180.0 22.41 MB

Internet without borders

Home Page: https://www.uproxy.org/

License: Apache License 2.0

JavaScript 9.07% Shell 2.54% HTML 10.58% TypeScript 76.33% CSS 0.40% Python 0.78% Dockerfile 0.30%
proxy-server peer-to-peer webrtc browser-extension university-of-washington

uproxy-p2p's Introduction

uProxy

uProxy is a browser extension that lets users share their internet connection.

Status

Slack Status Travis Status

Please read the uProxy Coding Guide to learn more about contributing to uProxy. For a high level technical overview of uProxy, see the uProxy Design Doc.

Tools

uProxy is built using the following tools:

  • Grunt to write the tasks that build uProxy
  • TypeScript as the primary language we code in; this compiles to JavaScript. It gives us type-checking and has some syntax improvements on JS, while letting us incrementally migrate and easily include external JS packages and frameworks.
  • Jasmine for testing
  • Polymer for UI
  • Travis for continuous integration

To manage dependencies we use:

  • npm to install node modules that we use for our build process. (Specified in package.json)
  • Bower to install libraries that we use in the UI (specified in bower.json) including Polymer.

Build

Prerequisites

  • Yarn. If you have npm, you can install with npm install -g --production yarn.
  • grunt-cli (once you've installed NPM, simply execute yarn global add --prod grunt-cli)

Building

First, to install required NPMs and configure the build/ directory for TypeScript compilation, execute:

yarn

Then, to compile the TypeScript code and build uProxy and all of the demo apps, execute:

grunt

Having problems? To clean up from a partial, broken, or extremely out-dated build, try executing this command before repeating the above steps:

yarn run clean

IDE

Visual Studio Code supports TypeScript compilation, search, and refactoring out of the box - just point it at the directory containing your uProxy clone.

Run

uProxy

Chrome

These are the steps to try uProxy in the Chrome browser.

  • In Chrome, go to chrome://extensions, make sure 'Developer mode' is enabled
  • Click 'Load unpacked extension...' and select build/src/chrome/app
  • Click 'Load unpacked extension...' and select build/src/chrome/extension

You need both the uProxy Chrome App and the uProxy Extension.

You can use grunt build_chrome from the root directory of the repository to re-compile just Chrome components.

Firefox

These are the steps to try uProxy in the Firefox browser.

  • To run the add-on you need to have the Firefox add-on SDK installed. Instructions can be found here: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation

    • A quick way to get started is to download/extract the zip mentioned in "Prerequisites"
  • Run cd build/src/firefox

  • Run cfx run and Firefox should launch with the uProxy add-on installed

You can use grunt build_firefox from the root directory of the repository to compile just Firefox comonents.

Demo apps

These can be found at build/src/samples/. They are a mix of web sites, browser extensions (Chrome and Firefox), and Node.js apps.

To run web apps:

To run Chrome apps:

  • open chrome://extensions, enable check Developer Mode, and load the unpacked extension from the relevant directory, e.g. build/src/samples/simple-socks-chromeapp/.

To run Firefox add-ons:

  • install jpm via NPM, e.g. yarn install jpm -g, cd to the relevant directory, e.g. build/src/samples/simple-socks-firefoxapp/, and execute jpm run -b `which firefox` .

To run Node.js apps:

  • Directly run node with the entry point, e.g. node build/src/samples/zork-node/index.js

Note: until freedom-for-node supports core.rtcpeerconnection, this sample will not work

More on the demo apps themselves:

  • simple-freedom-chat is a WebRTC-powered chat client, with both peers on the same page. This is the simplest possible demo src/peerconnection.
  • copypaste-freedom-chat is the simplest possible, distributed, src/peerconnection demo in which text boxes act as the signalling channel between two peers. Messages can be exchanged by email, IM, shared doc, etc.
  • echo-server starts a TCP echo server on port 9998. Run telnet 127.0.0.1 9998 and then type some stuff to verify that echo server echoes what you send it. Press ctrl-D to have the echo server terminate the connection or press ctrl-] then type quit to exit telnet.
  • Simple SOCKS is the simplest possible, single-page, demo of the SOCKS proxy (socks-to-rtc and rtc-to-net directories). This command may be used to test the proxy: curl -x socks5h://localhost:9999 www.example.com (-h indicates that DNS requests are made through the proxy too)
  • Zork is a distributed SOCKS proxy with a telnet-based signalling channel, intended for use with our Docker-based integration testing. Try connecting to Zork with telnet localhost 9000.
  • uProbe guess-timates your NAT type.
  • simple-churn-chat is just like simple-freedom-chat, except WebRTC traffic between the two peers is obfuscated. Wireshark may be used to verify that the traffic is obfuscated; the endpoints in use - along with a lot of debugging information - may be determined by examining the Javascript console.
  • copypaste-freedom-chat is just like copypaste-fredom-chat, except WebRTC traffic between the two peers is obfuscated.

Development and re-building uProxy

uProxy uses the Grunt build system for its build tasks. Here is a list of uProxy's Grunt commands:

  • build - Builds everything, making stuff in the build directory (and runs tests).
  • build_chrome - Build Chrome app and extension * build_chrome_app - Build just Chrome app * build_chrome_ext - Build just Chrome extension
  • build_firefox - Build just Firefox
  • dist - Generates distribution files, including the Firefox xpi
  • clean - Cleans up
  • test - Run unit tests
  • integration_test - Run integration tests
  • everything - 'build', 'test' and then 'integration_test'

The easiest way to stay current is to pull changes, run grunt build to build your distribution, and re-run as you make changes to the files.

Before submitting any changes to the repository, make sure to run grunt test to make sure it passes all unit tests. Failing tests are enough to immediately reject submissions. :)

uProxy for Mobile

The development for mobile platforms uses the Cordova Chrome Apps (CCA) tool, also known as the Chrome Apps for Mobile Toolchain. You can find the platform-specific information below:

Layout of files

Configuration and setup files

  • Gruntfile.js a file that specifies common tasks, e.g. how to build and package uProxy.
  • bower.json specifies dependent libraries from Bower.
  • package.json specifies dependent libraries from NPM.
  • .gitignore what git should ignore
  • .bowerrc tells bower where to put files
  • .travis.yml Travis auto-testing
  • tools directory contains some typescript and javascript to help Grunt.
  • third_party/tsd.json specifies the typescript definitions to use

Source code

  • src holds all source code; no compiled files
  • src/generic_ui generic user interface code
  • src/generic_core generic uproxy core-functionality code
  • src/chrome/app code specific to the chrome app
  • src/chrome/extension code specific to the chrome extension
  • src/firefox code specific to firefox
  • third_party holds external libraries we depend on that are copied into this repository
  • node_modules dynamically generated npm module dependencies
  • scraps temporary holding for sharing scraps of code

Dynamically created directories (grunt clean should remove them)

  • build created by grunt tasks; holds the built code, but none of the code that was compiled.
  • build/dist created by grunt tasks; holds final distribution versions
  • .grunt holds grunt cache stuff
  • .tscache holds typescript cache stuff

uproxy-p2p's People

Contributors

bemasc avatar blanu avatar dborkan avatar elewis97 avatar fortuna avatar gitlaura avatar iislucas avatar infmally avatar jab avatar jetpack avatar jpevarnek avatar kennysong avatar keroserene avatar klazizpro avatar lanterndev avatar lucyhe avatar masq avatar matthild avatar mohamedabdalkader avatar mollyling avatar myleshorton avatar nirvantyagi avatar paul-e avatar quantsword avatar ryscheng avatar shilpa10kumar9 avatar trevj avatar uzimizu avatar willscott avatar xwsxethan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uproxy-p2p's Issues

Set DNS server

Issue by ryscheng from Sat Oct 12 21:26:43 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/69


In setting a proxy, we should also be able to set custom DNS servers (i.e. Google's DNS service). it would be silly to proxy through a friend, but still be blocked because you're requesting DNS records from your local (censoring) DNS server.

Improve the form handling

Issue by infmally from Thu Dec 12 17:16:38 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/124


We should post using AJAX, update the page to say your request is being sent, and when added to spreadsheet, send email, and then provide success UI on the main page. The post request should return JSON. The current HTML output with the warning at the top about not being google is pretty suspicious for people in repressive countries. And it's a bit ugly :)

Abstract socket numbers in Chrome socket provider

Issue by Paul-E from Tue Oct 8 19:23:50 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/50


Currently every chrome socket provider gives access to every socket in use through any provider, because the provider uses the given Chrome socket numbers. Each socket provider should only provide access to sockets created through that provider.

This can be implemented as in Firefox, where each provider instance has a set of "External" socket numbers that map to "internal" (chrome provided) socket numbers. This per instance map should only contain sockets created through the instance that owns the map.

sorting by UProxy state vs. trust vs name

Issue by uzimizu from Fri Oct 11 21:17:07 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/60


Sort by name is alphabetical / default

Sort by UProxy puts contacts with valid instances on the top. People who are active are on the top.

  • First, the person you're actively getting access from.
  • Then people who are actively getting access from you
  • Then the people who have UProxy installed.
  • Then it's alphabetical (default)

Sort by My Access puts

  • Who you're actively getting access from first,
  • People who've trusted you to get access
  • People who've offered you access
  • People you've requested from
  • Alphabetical

Sort by Friends' Access puts

  • Who you're actively giving access to
  • Who you trust to give access to
  • Who you've offered access to
  • People who've requested access from you
  • Alphabetical

Sort by notifications

  • People who've had a status change
  • People who've requested access, and you can grant or deny
  • People who you've requested access from, and are waiting or can cancel
  • Alphabetical

"Loading..." appears at startup when no real loading is happening.

Issue by infmally from Wed Oct 30 18:54:02 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/112


Start with state like this:

state: {
"_debug": true,
"_msgLog": [],
"identityStatus": {
"xmpp": {
"message": "XMPP authentication failure",
"network": "xmpp",
"status": "error",
"userId": "[email protected]"
}
},
"me": {
"description": " aware daughter aching bear",
"instanceId": "beb63d96f06626b036fc4743ee89779efcafe1ea",
"keyHash": "4b:f3:0a:45:bf:cf:c3:12:80:d3:aa:2e:0e:63:50:0f:51:43:8a:02",
"identities": {},
"networkDefaults": {
"xmpp": {
"autoconnect": true
},
"google": {
"autoconnect": false
},
"facebook": {
"autoconnect": false
}
}
},
"roster": {},
"instances": {},
"clientToInstance": {},
"instanceToClient": {},
"options": {
"allowNonRoutableAddresses": false,
"stunServers": [
"stun:stun.l.google.com:19302",
"stun.services.mozilla.com"
],
"turnServers": [
"turnServer1",
"turnServer2"
]
}
}

Open the uproxy extension.

Observe:

  • It starts up with roster list and shows "Loading...".
  • No loading is really happening! It stays like that indefinitely.

Suggested behavior:

  • Do something that allows the user to 1. know they are not logged in, and 2. allows them to login.

implement keyboard shortcuts

Issue by uzimizu from Wed Oct 16 21:26:13 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/79


There is potential for keyboard shortcuts both in the UI and generally, whilst browsing.
For example, it may be good to toggle proxying without even using the popup or options page.
And:

  • When in contact view, Escape or Backspace when in contact view should bring us back to the roster.
  • When in roster view, arrow keys / j/k should navigate the roster, and Enter or Spacebar should open up the roster page.
  • Other actions shortcuts can be figured out. Maybe even let the user set the shortcuts.

Surface proxy errors

Issue by willscott from Fri Oct 18 19:25:17 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/103


chrome surfaces errors with requests to the set up proxy off of something like chrome.proxy.onError.addEventListener. If the proxy is a uproxy-configured proxy, we should be listening for such errors to see if something is up / change the icon / suggest other peers / stopping / etc.

disconnection in identity provider

Issue by uzimizu from Tue Oct 15 20:41:09 2013
Originally opened as https://github.com/UWNetworksLab/UProxy/issues/73


I connect, two uproxy instances seem to be talking to each other fine. I walk around the office for a bit, and the uproxy instances stop talking to each other. I check the log:

TypeError: Cannot call method 'send' of null
at IdentityProvider.sendMessage (chrome-extension://hilnpmepiebcjhibkbkfkjkacnnclkmi/common/backend/identity/xmpp/identity.xmpp.js:117:17)
at IdentityProvider. (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:1560:24)
at fdom.port.Provider.onMessage (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:1466:41)
at fdom.Hub.onMessage (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:244:30)
at Object. (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:2368:36)
at fdom.port.Worker.emitMessage (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:1962:8)
at null. (blob:chrome-extension%3A//hilnpmepiebcjhibkbkfkjkacnnclkmi/35e07037-131e-4ea1-8150-d96e317bd5f9:1947:10)

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.