elimisteve

arkOS: DelugeDNS Design

Nov 27th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. # DelugeDNS Design
  2.  
  3. ## Complete Flow of Deluge+/Deluge Direct/$name
  4.  
  5. 1. User installs arkOS
  6.  
  7. 2. User pays $3/month for Deluge Direct or whatever it's called so they don't have to open up a router port to benefit from Deluge
  8. and gets an authentication token as part of that process
  9.  
  10. 3. User types that auth token into the Deluge plugin for Genesis
  11.  
  12. 4. A Deluge client built into arkOS does an API call to the Deluge server, initiating a WebSocket connection that remains open
  13. suppose this user's chosen subdomain is user1.arkos.io
  14.  
  15. 5. A totally different user tries to visit http://user1.arkos.io/
  16.  
  17. 6. DNS resolves to the Deluge server, which then sees that user1's RPi is connected via WebSocket and should receive the request
  18.  
  19. 7. Deluge then performs said HTTP request (to user1.arkos.io) on behalf of the "totally different user" -- say, visitor1 -- over the existing WebSocket
  20. (06:48:26 PM) ArturoVM: Now comes the tricky part, I'm guessing.
  21.  
  22. 8. The Deluge client built into arkOS that is handling the WebSocket connection gets the request, then does an actual HTTP request to the local machine at the requested URL (in this case, "/", the home page)
  23.  
  24. 9. The Deluge client then receives that response and sends it via the existing WebSocket connection to Deluge
  25.  
  26. 10. Deluge (the Deluge server) then forwards that response data to visitor1
  27.  
  28. ---
  29.  
  30. The JSON would look like this:
  31.  
  32. {"url": "/admin/foo/bar", "method": "GET", "headers": {"User-Agent": "...", "Host": "...", "Accept": "..."}}
  33.  
  34. ...or possibly more like this:
  35.  
  36. {"protocol":"http", "port":80, "data":"GET /... "}
Advertisement
Add Comment
Please, Sign In to add comment