-
Notifications
You must be signed in to change notification settings - Fork 28
Web Demo
The Web demo includes client and server applications for browsing simple Web sites over XIA.
The Web server (webserver.py) written in Python that publishes static web pages as content chunks. When it launches, it scans and publishes all any files located in the local "www" directory. As a sample, we have included a copy of the XIA web site. Requests from the Web proxy arrive on XSOCK_STREAM sockets bound to the server's SID; the server looks up the requested page's content ID(s), which it stored when it published the content on launch and responds to the client request with those CIDs.
The XIA Web proxy (proxy.py and xiaproxy.py), also written in Python, send Web requests to the XIA Web server service. (That is, it connects to the Web server with an XSOCK_STREAM Xsocket using the server's Service ID.) The server responds with a list of Content IDs for the requested page, which the proxy then requests using an XSOCK_CHUNK Xsocket.
-
xia-core/web
- webserver.py -- the Web server
- www -- directory for content the Web server should publish as content chunks
- xiaproxy.py -- sends HTTP requests to the Web server using Xsockets
- proxy.py -- sends HTTP requests destined for the XIA Web server to xiaproxy.py; other requests handled normally
-
xia-core/web_demo
- TODO add description of stock, video, and hello servers
1) Start local XIA network:
cd xia-core/tools sudo ./xianet start
2) Make sure Python can find libxsocket.so by including it in your LD_LIBRARY_PATH. We've included a symlink in the web directory, so you could do this:
export LD_LIBRARY_PATH=.
3) Launch the demo services:
./run_demo start
4) Configure your browser to use the XIA Web proxy: If you're using firefox, the foxyproxy plug-in is useful. It provides url matching to support multiple proxies. if you are using one of the XIA virtual machines, the firefox browser is already configured to use foxyproxy.
On your browser, set the proxy to 127.0.0.1:8080. Configure the browser to proxy these patterns: http://xia.* http://*.xia/* http://www_* http://dag/* Don't Proxy: http://xia.cs.cmu.edu/* everything else! NOTE: XIA naming conventions are not set yet, so these settings will likely change in the future.
Foxyproxy users may also import this configuration file. Right click and save the file to disk. Then create a new proxy using 127.0.0.1:8080 as the proxy on the foxyproxy main page. On the URL patterns tab, click import and select this file.
5) Browse sample pages:
- In your browser, open the file "xia-core/web_demo/web_demo.html" and browse the links on this page.
cd xia-core/tools ./run_demo stop sudo ./xianet stop