index.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Snowflake</title>
  5. <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  6. <style>
  7. body {
  8. text-align: center; margin: auto;
  9. width: 50%;
  10. min-width: 40em;
  11. }
  12. textarea {
  13. width: 100%;
  14. height: 4em;
  15. font-size: 12px;
  16. resize: none;
  17. padding: 1em;
  18. }
  19. #options {
  20. background-color: rgba(0,0,0,0.8);
  21. color: #fff;
  22. resize: none;
  23. position: relative; border: none;
  24. width: 30rem;
  25. padding: 3rem; margin: auto; margin-top: 1rem;
  26. cursor: default;
  27. }
  28. #options .active {
  29. color: #2F2 !important;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <h1>Snowflake</h1>
  35. <p>
  36. <a href="https://trac.torproject.org/projects/tor/wiki/doc/Snowflake" target="_blank">Snowflake</a>
  37. is a WebRTC pluggable transport for Tor.
  38. </p>
  39. <p>
  40. This page enables you to use your web browser as a proxy to help other
  41. Internet users in censored places.
  42. When you click yes, your browser will act as a
  43. censorship circumvention proxy
  44. as long as you are viewing a page with the snowflake badge.
  45. </p>
  46. <div id='options'>
  47. <noscript>
  48. <hr/>
  49. Snowflake proxy requires javascript.
  50. <br/>
  51. To volunteer as a proxy, please enable javascript.
  52. </noscript>
  53. <div id='buttons' style='display:none'>
  54. <p>
  55. Do you want your browser to act as a proxy?
  56. </p>
  57. <p>
  58. <button onclick="enableSnowflake()">
  59. Yes
  60. </button>
  61. <button onclick="disableSnowflake()">
  62. No
  63. </button>
  64. </p>
  65. <div id="snowflake-status"></div>
  66. </div>
  67. <div id='cookies-disabled' style='display:none'>
  68. <hr/>
  69. <p>
  70. Your browser has cookies disabled. You will need to enable them in order
  71. to set Snowflake preferences.
  72. </p>
  73. </div>
  74. </div>
  75. <p>
  76. Minimum functionality has been achieved, and it is possible
  77. to bootstrap a Tor client to 100% using Snowflake, and the
  78. browsing experience using this PT is reasonable enough.
  79. </p>
  80. <p>
  81. However, Snowflake is also under active development and much work is needed.
  82. <br/>
  83. It is not yet stable or audited, probably has many issues,
  84. and should not yet be relied upon!!
  85. </p>
  86. See
  87. <a href="https://trac.torproject.org/projects/tor/wiki/doc/Snowflake"
  88. target="_blank">
  89. here</a> for more information.
  90. <hr>
  91. <p>
  92. It is now possible to embed the Snowflake badge on any website:
  93. </p>
  94. <textarea readonly>
  95. &lt;iframe src="https://snowflake.torproject.org/embed.html" width="88" height="16" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
  96. </textarea>
  97. <p>
  98. Which looks like this:
  99. </p>
  100. <iframe src="embed.html" width="88" height="16" frameborder="0" scrolling="no"></iframe>
  101. <p>
  102. If it animates, then congratulations -- you are currently acting as a Tor bridge.
  103. </p>
  104. <hr>
  105. Repo: <a target="_blank"
  106. href="https://gitweb.torproject.org/pluggable-transports/snowflake.git/">
  107. gitweb.torproject.org/pluggable-transports/snowflake.git
  108. </a>
  109. <br/>
  110. Last update: <time>2019-01-22</time>
  111. <script>
  112. // Defaults to opt-in.
  113. var COOKIE_NAME = "snowflake-allow";
  114. var COOKIE_LIFETIME = "Thu, 01 Jan 2038 00:00:00 GMT";
  115. function readCookie(cookie) {
  116. c = document.cookie.split('; ');
  117. cookies = {};
  118. for (i = 0 ; i < c.length ; i++) {
  119. pair = c[i].split('=');
  120. cookies[pair[0]] = pair[1];
  121. }
  122. return cookies[cookie];
  123. }
  124. function enableSnowflake() {
  125. setSnowflakeCookie(1);
  126. location.reload();
  127. }
  128. function disableSnowflake() {
  129. setSnowflakeCookie(0);
  130. location.reload();
  131. }
  132. function setSnowflakeCookie(val) {
  133. document.cookie = COOKIE_NAME + "=" + val + ";path=/ ;expires=" + COOKIE_LIFETIME;
  134. }
  135. window.onload = function() {
  136. if (navigator.cookieEnabled) {
  137. // Both JS and cookies enabled -- display normal buttons.
  138. document.getElementById('buttons').style = '';
  139. } else {
  140. // Display the cookies disabled message if necessary.
  141. document.getElementById('cookies-disabled').style = '';
  142. }
  143. var enabled = readCookie(COOKIE_NAME);
  144. var $status = document.getElementById('snowflake-status');
  145. if ("1" === enabled) {
  146. $status.innerHTML = 'Snowflake Proxy is ACTIVE <br/><br/>' +
  147. 'Thank you for contributing to internet freedom!';
  148. $status.className = 'active';
  149. } else {
  150. $status.innerHTML = 'Snowflake Proxy is OFF';
  151. $status.className = '';
  152. }
  153. }
  154. </script>
  155. </body>
  156. </html>