Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thesis idea: closing gap between (anonymous) web and P2P #11

Closed
synctext opened this issue Mar 7, 2013 · 11 comments
Closed

Thesis idea: closing gap between (anonymous) web and P2P #11

synctext opened this issue Mar 7, 2013 · 11 comments

Comments

@synctext
Copy link
Member

synctext commented Mar 7, 2013

Aim: create a fully functional web browser which also support (anonymous) P2P video streaming.

Outcome: P2P-Browser for HTML5-based websites with any-format video embedding, Javascript and CSS.

Approach: build upon the new WxWidget HTML rendering in wxpython 2.9:
http://docs.wxwidgets.org/trunk/classwx_web_view.html
A browser in 800 lines: http://trac.wxwidgets.org/browser/wxWidgets/branches/SOC2011_WEBVIEW/samples/webview/webview.cpp
We can even play Youtube (and grab it for P2P seeding in Libswift it seems):

wxWebView *webview = wxWebView::New(this, wxID_ANY, "http://www.youtube.com/watch?v=zwDvF0NtgdU");
webview->RunScript("function onYouTubePlayerReady(playerId) 
     {document.getElementById('watch-player').playVideo();}");

For windows, HTML5 video tag support needs IE9 libs :-(

For P2P streaming we build upon our own upcoming IETF Internet Standard work: https://datatracker.ietf.org/doc/draft-ietf-ppsp-peer-protocol/
We use VLC to PlayVideo(), render in that windows and support any video format plus HTML5 power?
Old VLC adding patch exists: http://trac.wxwidgets.org/ticket/10264

P2P streaming support appears easy to add via the wxWebViewHandler. Assuming Python we can make a call to the libswift process and present the output of the HTTPGW as the inputstream for the web engine.
VLC will be used for playback. All mainstream containers+codecs will thus be supported, so we've created a HTML5 element that can play all formats. Bittorrent swarms can thus be easily be supported.

Limitation: web sites need to be specifically created to support Youtube-like P2P streaming.

@synctext
Copy link
Member Author

Concreet project ToDo list:
-Eclipse: run Tribler from sources
-wxWebView working in Tribler with hardcoded youtube clip
-grab youtube video file
-seed in P2P using Libswift in Tribler
-play on another Tribler
-Open-ended assignment then midway/scrum targets the following will be targetted:
--Optional0: Support for P2P streaming URLs. HTML5 "< video >" tag is expanded with ppsp://db5dabb90a3cbd61a90866a4cc208ae959440ec9 support
--Optional1: show any website using address bar (standard HTTP fetch)
--Optional2: download content via P2P protocol anonymously
--Optional3: convert any encountered magnet:// URL link into a Youtube-like player window
--Optional4: foundation for AnonTube research of Tribler team (ambitious and on critical path) #119

prior work 4 years ago, read thesis .PDF:
http://www.tribler.org/P2PWebhosting

@synctext
Copy link
Member Author

planning

14 June code submission
Report submit
4 July presentation day (tentative)

NielsZeilemaker pushed a commit to NielsZeilemaker/tribler that referenced this issue May 3, 2013
@synctext
Copy link
Member Author

synctext commented May 8, 2013

Note, above "webview->RunScript()" example might not work due to lack of page loading complete: http://trac.wxwidgets.org/ticket/14326

@synctext
Copy link
Member Author

synctext commented May 8, 2013

HTML dynamic rewriting is seen as a difficult technical problem.
Either this will need significant engineering effort, a smart & fancy solution or we simply avoid this issue and alter course.

@NielsZeilemaker
Copy link
Contributor

Your comments don't seem to be true, according to the ticket you referenced the runscript command will not work until the page is fully loaded. Therefore, simply waiting for the page to be fully loaded seems to be fine.

If we want to replace/modify urls in the video tag, then we can simply pass all http traffic through a proxy which rewrites the html.

@synctext
Copy link
Member Author

synctext commented May 8, 2013

after initial work and results the following target as end-goal was discussed:
single-page web mirror service; eternal availability of wikipedia and wikileaks.

@qstokkink
Copy link
Contributor

@qstokkink
Copy link
Contributor

RunScript issue (mystery segfault) resolved:
You cannot access a wx.html2.WebView object's RunScript outside of the main App event dispatch loop.
For seperate threads this must be invoked using the wx.CallAfter function.
For example here is a function that waits for an initial load of a webpage and executes some javascript on it:

def execute_on_load(browser, javascript):
    '''browser: wx.html2.WebView object
        javascript: string containing javascript code
    '''
    while (browser.GetCurrentURL() == "about:blank"):
        time.sleep(0.3)
    wx.CallAfter(browser.RunScript, javascript)

@qstokkink
Copy link
Contributor

Status update:
With the wx functionality implemented in the latest wxPython version (Phoenix) we can now parse any webpage (not just wikipedia and wikileaks pages) and have its local copy look good.
Even though Phoenix murders all applications based on previous wxPython versions, we have managed to port Tribler to it (albeit with some deprecation warnings).

@whirm
Copy link
Contributor

whirm commented May 15, 2013

For what I can see, this is an unreleased development branch of WX.

Are we planning on using this on production versions of Tribler? (and hence packaging for all our supported platforms)

@synctext
Copy link
Member Author

synctext commented Nov 3, 2014

Ticket done: bsc thesis completed
"Closing the gap between the Web and Peer to Peer"
http://repository.tudelft.nl/view/ir/uuid%3Ac51e551d-22a6-46e8-ba56-0109bb134ae7/

Abstract
During the course of Q4 of the 2012-2013 academic year, we have worked on the project of a Peer-to-Peer web browser. After a two week orientation phase, a six week programming phase and nally another two week reporting phase we deliver our product. The final result of this endeavor is an integrated web browser in the Tribler platform, which supports automatic retrieval and distribution of resources encountered on the web page.

@synctext synctext closed this as completed Nov 3, 2014
NielsZeilemaker pushed a commit to NielsZeilemaker/tribler that referenced this issue Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants