-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path04-HTTP.html
5211 lines (3352 loc) · 182 KB
/
04-HTTP.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CMPUT 404</title>
<!-- Styling from reveal.js -->
<link rel="stylesheet" href="node_modules/reveal.js/css/reveal.css">
<link id="revealtheme" rel="stylesheet" href="">
<!-- Theme used for syntax highlighting of code -->
<link id="highlighttheme" rel="stylesheet" href="">
<!-- Custom Styling -->
<link rel="stylesheet" href="cmput404-slides.css">
<link id="404theme" rel="stylesheet" href="">
<!-- Scripts! -->
<script src="node_modules/reveal.js/lib/js/head.min.js"></script>
<script src="node_modules/reveal.js/js/reveal.js"></script>
<script src="node_modules/chai/chai.js"></script>
<script src="node_modules/fitty/dist/fitty.min.js"></script>
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js"></script>
<script src="node_modules/highlightjs/highlight.pack.js"></script>
<script src="fiddler.js"></script><!-- make sure fiddler is last -->
</head>
<body>
<div class="reveal">
<div class="slides">
<!-- Anything before this will be sync'd with the other files in the directory if you run ./sync-header-footer.py *.html
HEADER --------------------------
-->
<section>
<h1>CMPUT 404</h1>
<h3>Web Applications and Architecture</h3>
<h2>Part 04: HTTP</h2>
<p>
<small>Created by <br>
<a href="http://softwareprocess.es">Abram Hindle</a>
(<a href="mailto:abram.hindle@ualberta.ca">abram.hindle@ualberta.ca</a>) <br>
and Hazel Campbell (<a href="mailto:hazel.campbell@ualberta.ca">hazel.campbell@ualberta.ca</a>).<br>
Copyright 2014-2019.
</small>
</p>
</section>
<section>
<h3>Context: FTP vs HTTP</h3>
<div class="columns" style="font-size: 80%">
<div class="column">
<ul>
<li>1971</li>
<li>Just files and lists of files (aka directories)</li>
<li>Out of band communication (files xferred via 2nd connection)</li>
<li>Firewalls prevent server connecting back to client (fixed with passive mode)</li>
<li>200 OK</li>
<li>Must log in everytime, but by convention anonymous logins</li>
</ul>
</div>
<div class="column">
<ul>
<li>1991</li>
<li>Sends content, not files</li>
<li>Responds to requests: GET/POST/DELETE/PUT/HEAD/etc.</li>
<li>Allows extra information (headers) and arguments (queries) with commands</li>
<li>200 OK</li>
<li>Default: anonymous, no log-in</li>
<li>Dynamic content (generated at the time the request is received)</li>
</ul>
</div>
</div>
</section>
<section>
<h3>Context: Gopher vs HTTP</h3>
<div class="columns" style="font-size: 80%">
<div class="column">
<ul>
<li>1991</li>
<li>Sends files, directories</li>
<li>Simple</li>
<li>Hypertext</li>
<li>Limited file types: menus, text, binary, gif, image</li>
<li>Death by licensing and adoption</li>
</ul>
</div>
<div class="column">
<ul>
<li>1991</li>
<li>Sends content, not files</li>
<li>Responds to requests: GET/POST/DELETE/PUT/HEAD/etc.</li>
<li>More complex</li>
<li>Any type of content</li>
</ul>
</div>
</div>
</section>
<section>
<h3>HTTP</h3>
<ul style="font-size: 90%">
<li>Hypertext — "over" text</li>
<li>Transport — Move it/communicate it</li>
<li>Protocol — an agreed-upon method of communication</li>
<li>Accepted custom headers — allowing for extension, new features</li>
<li>Allowed for a more request/command oriented pattern (remember the command pattern)</li>
<li>Relied on the pairing of web clients and web servers</li>
<li>Relies on URIs to describe resources, allows more than 1 resource to be hosted on 1 server</li>
</ul>
</section>
<section>
<ul>
<li>RFC: The standard for HTTP: <a href="http://tools.ietf.org/html/rfc2616">http://tools.ietf.org/html/rfc2616</a></li>
<li>RFC: Request For Comments
<ul>
<li>Hypertext Transfer Protocol — HTTP/1.1</li>
<li>IETF's definion of HTTP/1.1</li>
</ul>
</li>
<li>No matter what I say about HTTP, the RFC is the final word.</li>
</ul>
</section>
<section>
<h3>HTTP Basics</h3>
<ul>
<li>HTTP uses TCP (usually)</li>
<li>HTTP uses TCP Port 80 (usually)
</li>
<li> HTTPS allows for ENCRYPTED HTTP
</li>
<li>HTTPS uses port TCP 443 (usually)
</li>
<li> HTTP can work over IPV4 and IPV6
</li>
<li>HTTP requests are made to addresses called
URIs
</li>
</ul>
</section>
<section>
<h3>HTTP Commands</h3>
Every HTTP command is made to a URI.
<ul style="font-size: 90%">
<li>GET – Retrieve information from that URI
</li>
<li>POST – Run search, log-in, append data, change data
</li>
<li>HEAD – GET without a message body (for caching)
</li>
<li>PUT – Store the entity at the that URI
</li>
<li> DELETE – Delete the resource at that URI
</li>
<li class="rare">PATCH – Modify the entity at that URI
</li>
<li class="rare">OPTIONS – What options a resource can accommodate
</li>
<li class="rare">TRACE – Debugging / Echo Request
</li>
<li class="rare">CONNECT – Tunneling proxy over HTTP
</li>
</ul>
</section>
<section>
<h3>URI or URL?</h3>
URI
<ul style="font-size: 85%">
<li>Universal Resource Identifier
</li>
<li>Identifies (points to) a resource</li>
<li>Most URIs are URLs
<ul>
<li>URL: Uniform Resource Locator
</li>
<li>Tells you how to get to a resource</li>
<li><var>http://ualberta.ca/</var></li>
</ul>
</li>
<li>Some URIs are URNs
<ul>
<li>URN: Uniform Resource Name</li>
<li>Tells you the unique name or number given to a resource by some body (e.g. IETF)</li>
<li><var>urn:ietf:rfc:3986</var></li>
</ul>
</li>
</ul>
</section>
<section>
<h3>URLs</h3>
<ul>
<li>Two main parts: scheme and everything else</li>
</li>
<li>Common URL Schemes: <var>http</var>, <var>https</var>, <var>mailto</var>, <var>file</var>, <var>data</var></li>
<li>URL Schemes for older technologies: <var>ftp</var>, <var>gopher</var>, <var>irc</var></li>
<li>URI Schemes for new technologies: <var>spotify:track:35zrlBOjpfDPMcZzglWOuV</var></li>
</ul>
</section>
<section>
<h3>URLs</h3>
<ul>
<li>scheme</li>
<li>:</li>
<li>authority
<ul>
<li>username:password@ (optional)</li>
<li>hostname</li>
<li>:port (optional)</li>
</ul>
</li>
<li>path</li>
<li>?query (optional)</li>
<li>#argument (optional)</li>
</ul>
<p>Username/password not used much anymore...</p>
</section>
<section>
<p style="font-size: 80%"><var>http://joe:hunter23@[::1]:8000/search.html?q=cat%20pictures&results=20#result-10</var></p>
<div class="columns" style="font-size: 80%;">
<div class="column">
<ul>
<li>scheme <var>http</var></li>
<li>:</li>
<li>authority <var>joe:hunter23@[::1]:8000</var>
<ul>
<li>Username <var>joe</var></li>
<li>Password <var>hunter23</var></li>
<li>@</li>
<li>Host <var>[::1]</var></li>
<li>:</li>
<li>Port <var>8000</var></li>
</ul>
</li>
</ul>
</div>
<div class="column">
<ul>
<li>path <var>search.html</var></li>
<li>?</li>
<li>?query <var>?q=cat%20pictures&results=20</var></il>
<li>#</li>
<li>fragment <var>#result-10</var></li>
</ul>
<p style="font-size: 50%;">[::1] is IPv6 loopback address, like IPv4's 127.0.0.1</p>
</div>
</div>
</section>
<section>
<h3>Absolute and relative URLs</h3>
<ul>
<li><a href="http://[::1]:8000/images/web-server.svg">http://[::1]:8000/images/web-server.svg</a>
<ul>
<li>Absolute authority, absolute path</li>
</ul>
</li>
<li><a href="http://[::1]:8000/images/../index.html">http://[::1]:8000/images/../index.html</a>
<ul>
<li>Absolute authority, relative path</li>
</ul>
</li>
<li><a href="/images/web-server.svg">/images/web-server.svg</a>
<ul>
<li>Implied authority, absolute path</li>
</ul>
</li>
<li><a href="images/web-server.svg">images/web-server.svg</a>
<ul>
<li>Implied authority, relative path</li>
</ul>
</li>
</ul>
</section>
<section>
<h3>Example URLs</h3>
<ul>
<li><a href="http://uofa-cmput404.github.io/cmput404-slides/index.html">http://uofa-cmput404.github.io/cmput404-slides/index.html</a>
<ul>
<li>Result: opens webpage (slides)</li>
</ul>
</li>
<li><a href="mailto:hazel.campbell@ualberta.ca">mailto:hazel.campbell@ualberta.ca</a>
<ul>
<li>Result: opens email client (new email to Hazel)</li>
</ul>
</li>
<li><a href="spotify:track:6i7BrJ729QLUemr0i4rLU2">spotify:track:6i7BrJ729QLUemr0i4rLU2</a>
<ul>
<li>Result: opens Buddy Rich's version of Weather Report's Jazz hit Birdland in Spotify</li>
</ul>
</li>
<li><a href="tel:+1-211-867-5309">tel:+1-211-867-5309</a>
<ul>
<li>Result: calls Jenny</li>
</ul>
</li>
</ul>
</section>
<section>
<h3>Queries</h3>
<p>URLs can have a query portion. Consider <a href="https://www.google.com/search?q=cat+pictures&ie=utf8">https://www.google.com/search?q=cat+pictures&ie=utf8</a></p>
<ul>
<li>Query portions can have one or more arguments</li>
<li>Usually: <var>key=value&key2=value2</var></li>
<li>But some other formats exist, such as using other separators <var>;</var> instead of <var>&</var>, or just having a string and no keys/values.</li>
</ul>
</section>
<section>
<h3>Fragments</h3>
<p>URLs can have a fragment portion. Consider <a href="https://en.wikipedia.org/wiki/Methanol#Applications">https://en.wikipedia.org/wiki/Methanol#Applications</a></p>
<ul>
<li>Jumps to some spot in the content
<ul>
<li>Jumps to a time in a video: <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=98s">https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=98s</a></li>
<li>Jumps to a part of a page: <a href="https://en.wikipedia.org/wiki/Methanol#Applications">https://en.wikipedia.org/wiki/Methanol#Applications</a></li>
<li>Jumps to a slide: <a href="#/0">#/0</a></li>
</li>
</ul>
</section>
<section>
<h3>Why are URLs important?</h3>
<ul style="font-size: 80%;">
<li>True names...
<ul>
<li>Rumpelstiltskin</li>
</ul>
</li>
<li>The Laws of Magic!
<ul>
<li>The Law of Names — Knowing the complete true name of an entity gives one control over it. <a href="http://deoxy.org/lawsofmagic.htm">http://deoxy.org/lawsofmagic.htm</a></li>
</ul>
</li>
<li>URL
<ul>
<li>Knowing the complete true URL lets one request/command it.
<ul>
<li>Like that URL for the weather...<a href="http://dd.weather.gc.ca/citypage_weather/xml/AB/s0000045_e.xml">http://dd.weather.gc.ca/citypage_weather/xml/AB/s0000045_e.xml</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h3>URIs and Encoding</h3>
<ul style="font-size: 75%">
<li>Universal URIs have to be able to handle anything</li>
<li>Even paths with spaces and other characters... (accents, punctuation, symbols, emoji...)</li>
<li>For HTTP assume our URLs are Unicode UTF-8 encoded</li>
<li>For characters that <em>aren't</em> in <var>-._~0-9a-zA-Z</var> we use % encoding
<ul>
<li>RFC 3986</li>
<li><var>%20</var> is space</li>
<li><var>%e2%98%83</var> is ☃ (<var>&#x2603;</var> in HTML)</li>
<li><a href="images/%E2%98%83.svg"><var>images/%E2%98%83.svg</var></a></li>
</ul>
</li>
<li>For domain names we use "punycode" encoding
<ul>
<li>http://☃.net/ which is converted to http://xn--n3h.net/</li>
</ul>
</li>
</ul>
</section>
<section>
<h3>HTTP Example</h3>
<p>Let's <var>GET http://slashdot.org</var></p>
<ul>
<li>Request <a href="http://slashdot.org">http://slashdot.org</a></li>
<li>We see http, so we know it's going to be the HTTP protocol.</li>
<li>No port specified so assume port 80.</li>
<li>No path specified so assume /</li>
</ul>
</section>
<section>
<ul>
<li>Open up a connection to port 80 slashdot.org</li>
<li>Send...
</ul>
<pre><code class="http">GET / HTTP/1.1\r\n
Host: slashdot.org\r\n
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
Connection: keep-alive\r\n
Upgrade-Insecure-Requests: 1\r\n
DNT: 1\r\n
\r\n</code></pre>
<ul>
<li><var>/</var> in <var>GET /</var> is the path: we're asking for the root aka the index of the root directory.</li>
<li><var>Host: slashdot.org</var>... wait... I thought we already knew the IP address?</li>
</ul>
</section>
<section>
<ul>
<li>Receive headers...</li>
</ul>
<pre><code class="http">HTTP/1.1 301 Moved Permanently\r\n
Server: nginx/1.13.12\r\n
Date: Mon, 14 Jan 2019 23:18:22 GMT\r\n
Content-Type: text/html\r\n
Content-Length: 186\r\n
Connection: keep-alive\r\n
Location: https://slashdot.org/\r\n
\r\n</code></pre>
<ul>
<li><var>301 Moved Permanently</var> — your princess is in another castle.</li>
</ul>
</section>
<section>
<ul>
<li>Receive content...</li>
</ul>
<pre><code class="html"><html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.13.12</center>
</body>
</html></code></pre>
<ul>
<li>Webpage should redirect, following the location header, but in case it doesn't we're provided a short HTML page as well to explain the situation.</li>
</ul>
</section>
<section>
<ul>
<li>So the browser doesn't show you this page, instead it goes to the location specific in the <var>Location</var> header.</li>
</ul>
<pre><code class="http">Location: https://slashdot.org/\r\n</code></pre>
<ul>
<li>It's sending us to the same slashdot page we asked for, except now, HTTPS!</li>
<li>HTTPS: Encrypted... but... everyone still knows we're on slashdot. They might not be able to tell <em>where</em> on slashdot we are though.</li>
<li style="font-size: 75%">Time for our web browser to try again...</li>
</ul>
</section>
<section>
<ul>
<li>Browser connects to slashdot.org on port 443.</li>
<li>Browser initiates a TLS connection!</li>
<li>For HTTP our layers look like:
<ul>
<li>Ethernet</li>
<li>IPv4</li>
<li>TCP</li>
<li>HTTP</li>
</li>
</ul>
</section>
<section>
<ul>
<li>Browser connects to slashdot.org on port 443.</li>
<li>Browser initiates a TLS connection!</li>
<li>For HTTPS our layers look like:
<ul>
<li>Ethernet</li>
<li>IPv4</li>
<li>TCP</li>
<li style="font-size: 75%">TLS</li>
<li>HTTP</li>
</li>
<li>Squeeze in TLS between TCP and HTTP.</li>
</ul>
</section>
<section>
<ul>
<li>Open up a connection to port 443 slashdot.org</li>
<li>Do a TLS handshake and open up TLS connection</li>
<li>Send...
</ul>
<pre><code class="http">GET / HTTP/1.1\r\n
Host: slashdot.org\r\n
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
Connection: keep-alive\r\n
Upgrade-Insecure-Requests: 1\r\n
DNT: 1\r\n
\r\n</code></pre>
</section>
<section>
<ul>
<li>Receive headers...</li>
</ul>
<pre><code class="http">HTTP/1.1 200 OK\r\n
Server: nginx/1.13.12\r\n
Date: Mon, 14 Jan 2019 23:18:22 GMT\r\n
Content-Type: text/html; charset=utf-8\r\n
Transfer-Encoding: chunked\r\n
Connection: keep-alive\r\n
SLASH_LOG_DATA: shtml\r\n
Cache-Control: no-cache\r\n
Pragma: no-cache\r\n
X-XRDS-Location: https://slashdot.org/slashdot.xrds\r\n
Strict-Transport-Security: max-age=31536000\r\n
Content-Encoding: gzip\r\n
\r\n</code></pre>
<ul>
<li><var>200 OK</var> — okay, I did what you asked, everything went fine.</li>
</ul>
</section>
<section>
<ul>
<li>Receive content...</li>
<li>Just get garbled binary junk... no HTML</li>
<li><var>Content-Encoding: gzip</var></li>
<li>Web browser has to uncompress it first</li>
</ul>
</section>
<section>
<ul>
<li>Decompress content...</li>
</ul>
<pre><code class="html" style="width: 100%; padding: 0; margin: 0; font-size: 75%;"><!-- html-header type=current begin -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Render IE9 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script>window.is_euro_union = 1;</script>
<script src="https://a.fsdn.com/con/js/sftheme/vendor/promise.polyfill.min.js"></script>
<script src="https://a.fsdn.com/con/js/sftheme/cmp.js"></script>
<script src="https://slashdot.org/country.js"></script>
<script type='text/javascript'>
if (window.is_euro_union) {
bizx.cmp.init({
// to test: 'Display UI': 'always',
'Publisher Name': 'Slashdot',
'Publisher Logo': 'https://a.fsdn.com/sd/sdlogo.svg',
'Consent Scope': 'global group',
'Consent Scope Group URL': 'https://slashdot.org/gdpr-cookies.pl',
});
}
</script>
<link rel="stylesheet" href="//a.fsdn.com/con/css/sftheme/sandiego/cmp.css" type="text/css">
<style type="text/css">
.qc-cmp-publisher-logo, .qc-cmp-nav-bar-publisher-logo {
background-color: #016765;
}
</style>
<script>
if (!window.is_euro_union) {
(function (s,o,n,a,r,i,z,e) {s['StackSonarObject']=r;s[r]=s[r]||function(){
(s[r].q=s[r].q||[]).push(arguments)},s[r].l=1*new Date();i=o.createElement(n),
z=o.getElementsByTagName(n)[0];i.async=1;i.src=a;z.parentNode.insertBefore(i,z)
})(window,document,'script','https://www.stack-sonar.com/ping.js','stackSonar');
stackSonar('stack-connect', '66');
}
</script>
<script id="before-content" type="text/javascript">
(function () {
if (typeof window.sdmedia !== 'object') {
window.sdmedia = {};
}
if (typeof window.sdmedia.site !== 'object') {
window.sdmedia.site = {};
}
var site = window.sdmedia.site;
site.rootdir = "//slashdot.org";
}());
var pageload = {
pagemark: '82601476630593824',
before_content: (new Date).getTime()
};
function pageload_done( $, console, maybe ){
pageload.after_readycode = (new Date).getTime();
pageload.content_ready_time = pageload.content_ready - pageload.before_content;
pageload.script_ready_time = pageload.after_readycode - pageload.content_ready;
pageload.ready_time = pageload.after_readycode - pageload.before_content;
// Only report 1% of cases.
maybe || (Math.random()>0.01) || $.ajax({ data: {
op: 'page_profile',
pagemark: pageload.pagemark,
dom: pageload.content_ready_time,
js: pageload.script_ready_time
} });
}
</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Slashdot: News for nerds, stuff that matters</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.">
<meta property="og:title" content="Slashdot: News for nerds, stuff that matters">
<meta property="og:description" content="Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.">
<meta property="fb:admins" content="100000696822412">
<meta property="fb:page_id" content="267995220856">
<meta name="viewport" content="width=1000, user-scalable=yes, minimum-scale=0, maximum-scale=10.0" >
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="canonical" href="https://slashdot.org">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.slashdot.org" >
<link rel="stylesheet" type="text/css" media="screen, projection" href="//a.fsdn.com/sd/classic.ssl.css?0771f26796689b4c" >
<!--[if IE 8]><link rel="stylesheet" type="text/css" media="screen, projection" href="//a.fsdn.com/sd/ie8-classic.ssl.css?0771f26796689b4c" ><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen, projection" href="//a.fsdn.com/sd/ie7-classic.ssl.css?0771f26796689b4c" ><![endif]-->
<!-- -->
<!-- SMACKS: NEW CSS -->
<link rel="stylesheet" href="//a.fsdn.com/sd/css/app.css?0771f26796689b4c">
<script type='text/javascript'>
var _gaq = _gaq || [];
</script>
<script type="text/javascript" id="pbjs_script" data-dom="https://d3tglifpd8whs6.cloudfront.net" src="https://d3tglifpd8whs6.cloudfront.net/js/prebid/slash-homepage/slash-homepage.min.js"></script>
<script type='text/javascript'>
/*global performance */
var googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
window.Ads_disallowPersonalization = 1;
bizx.cmp.ifConsent('all', 'all', function(){
window.Ads_disallowPersonalization = 0;
}, function(){
window.Ads_disallowPersonalization = 1;
}, function () {
window.bizxPrebid.Ads.initPrebid(window.bizxPrebid.adUnits);
});
</script>
<!-- prep GPT ads -->
<script type='text/javascript'>
(function() {
function page_type (loc) {
/*
only four page types:
- Story
- Poll
- Homepage (/ only)
- Other (but AdOps wants 'Homepage' again)
*/
var path = loc.pathname;
var just_the_root = /^\/?$/.test(path);
var story_or_poll = /^\/(story(?=\/)|submission(?=\/)|poll(?=\/|Booth|s\b))/i.exec(path);
var page_type = just_the_root ? 'homepage'
: story_or_poll ? story_or_poll[1]
: 'other'
// exceptions
if (page_type.toLowerCase() === 'submission')
page_type = 'story'; // submissions are like stories, right?
else if (page_type.toLowerCase() === 'other')
page_type = 'homepage'; // this one might move out of here
return page_type;
}
function page_section (loc) {
//var greek = ['alpha', 'beta', 'gamma', 'delta'].join('|');
//var hostwise = '^([a-z]+)(?:-(?:'+greek+'))?\\.(?:slashdot\\.org|\\.xb\\.sf\\.net)$';
var pathwise = '^/(?:(recent|popular|blog)|stories/([^/]+))';
var rootwise = '^\/?$';
//var hostwisely = new RegExp(hostwise,'i').exec(loc.hostname);
var pathwisely = new RegExp(pathwise,'i').exec(loc.pathname);
var rootwisely = new RegExp(rootwise,'i').exec(loc.pathname);
var section = (rootwisely && 'homepage')
|| (pathwisely && (pathwisely[1] || pathwisely[2]))
|| ''
;
return section.replace(/[^_a-z]/ig, '');
}
function single_size (size) {
return '' + size[0] + 'x' + size[1];
}
function sz_sz (sz) {
var str = '';
var sizes = [];
if (sz[0] instanceof Array) {
for (size in sz) {
sizes.push(single_size(sz[size]));
}
return sizes.join(',');
} else {
return single_size(sz);
}
}
function unique_tpc_array(array1,array2) {
var j = array1.concat(array2);
j.forEach(function (v,i,a) {
a[i] = v.replace(/[^_a-z]/ig, '');
});
return j.filter(function (v,i,a) {
return v != '' && a.indexOf(v) === i;
});
}
/* LEGEND:
- 'sz' = "size"
- 'npt' = "no page type" in ad unit name
*/
var tags = {
'728x90_A': { 'sz': [[728, 90], [970, 90], [970, 250], [980, 66]] },
'728x90_B': { 'sz': [728, 90] },
'728x90_C': { 'sz': [728, 90], 'skip': { 'homepage': 1 } },
'HubIcon_200x90_A': { 'sz': [[200, 90], [220, 90]]},
'PowerSwitch_980x66_A': { 'sz': [980, 66], 'skip': { 'homepage': 1 } },
'PollPeel': { 'sz': [200, 90], 'skip': { 'homepage': 1 } },
//'VideoWidget_300x250': { 'sz': [300, 250], 'npt': 1 },
'300x250_A': { 'sz': [[300, 250], [300, 600], [300, 1050]] },
'300x250_B': { 'sz': [[300, 250], [300, 600]] },
'300x250_C': { 'sz': [[300, 250], [300, 600]] },
'300x250_D': { 'sz': [[300, 250], [300, 600]] },
'Pulse_300x600_A': { 'sz': [300, 600] },
//'Polls_Detail_300x250_A': { 'sz': [[300, 250], [300, 600]], 'npt': 1 },
//'Poll_300x250_A': { 'sz': [[300, 250], [300, 600]], 'npt': 1 },
//'SD_Story_1x1': { 'sz': [1, 1] },
'1x1': { 'sz': [1, 1] }
};
//var network_path = '/41014381/Slashdot/';
var network_path = '/41014381/Slashdot/';
var tag_name_prefix = 'SD';
var tag_name_linkage = '_';
var tag_name_pagetype = page_type(location);
var tag_topic = page_section(location);
if(tag_name_pagetype == 'poll'){
tag_name_pagetype = 'Poll';
}
var before_tag_pagetyped = network_path
+ tag_name_prefix
+ tag_name_linkage
+ tag_name_pagetype
+ tag_name_linkage
;
var before_tag_pagetypeless = network_path
+ tag_name_prefix
+ tag_name_linkage
/* + tag_name_pagetype */
/* + tag_name_linkage */
;
googletag.cmd.push(function() {
function remove_sticky_top() {
//console.log('run remove sticky banner');
setTimeout(function(){
$('#div-gpt-ad-728x90_a').parent('div').addClass('adwrap-viewed-banner');
$('#div-gpt-ad-728x90_a').addClass('viewableImpression');
}, 1000);
}
function remove_sticky_railad() {
//console.log('run remove sticky railed');
setTimeout(function(){
$('#slashboxes .adwrap-unviewed').addClass('adwrap-viewed-railad');
$('.railad').addClass('viewableImpression');
}, 1000);
}
function viewable_imp (slot) {
//console.log('init ads detect');
for(var i in slot) {
if(typeof slot[i] !== 'string') continue;
switch(slot[i]){
case "/41014381/Slashdot/SD_homepage_728x90_A":
case "/41014381/Slashdot/SD_story_728x90_A":
case "/41014381/Slashdot/SD_Poll_728x90_A":
case "/41014381/Slashdot/SD_homepage_728x90_Ref_A":
case "/41014381/Slashdot/SD_story_728x90_Ref_A":
case "/41014381/Slashdot/SD_Poll_728x90_Ref_A":
remove_sticky_top();
break;
case "/41014381/Slashdot/SD_homepage_300x250_A":
case "/41014381/Slashdot/SD_story_300x250_A":
case "/41014381/Slashdot/SD_Poll_300x250_A":
case "/41014381/Slashdot/SD_homepage_300x250_Ref_A":
case "/41014381/Slashdot/SD_story_300x250_Ref_A":
case "/41014381/Slashdot/SD_Poll_300x250_Ref_A":
remove_sticky_railad();
break;
}
//if(slot[i] === "/41014381/Slashdot/SD_homepage_728x90_A") remove_sticky_top();
//if(slot[i] === "/41014381/Slashdot/SD_homepage_300x250_A") remove_sticky_railad();
}
}
function define_me_a_slot (tag) {
if (tags[tag].skip && tags[tag].skip[tag_name_pagetype])
return;
var sandbox_regex = /\.xb\.sf\.net$/i;
var full_name = tags[tag].npt // "no page type"
? before_tag_pagetypeless + tag
: before_tag_pagetyped + tag
;
var div_id = 'div-gpt-ad-' + tag.toLowerCase();
var service;
// extend jQuery and get URL query params
jQuery.extend({
getQueryParameters : function(str) {
return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){
return n = n.split("="),this[n[0]] = n[1],this
}.bind({}))[0];
}
});
var queryParams = $.getQueryParameters();
if( queryParams.source === 'autorefresh' ) {
full_name = full_name.replace(/(\d+x\d+)/,'$1_Ref');
//console.log('TAG NAME: ', full_name);
}
service = googletag.defineSlot(
full_name
, tags[tag].sz
, div_id
).addService(googletag.pubads());
service.setTargeting('sz', tags[tag].sz);
var frontend_tpc = tag_topic.split(",");
var backend_tpc = [ ];
var tpc_final = unique_tpc_array(frontend_tpc, backend_tpc);
service.setTargeting('tpc', tpc_final);
if (location.hostname.match(sandbox_regex)) {
service.setTargeting('test', 'adops');
}
}
for (tag in tags) {
define_me_a_slot(tag, false);
}
googletag.pubads().addEventListener('impressionViewable', function(event) {
viewable_imp(event.slot);
});
googletag.pubads().setTargeting('requestSource', 'GPT');
googletag.pubads().setRequestNonPersonalizedAds(window.Ads_disallowPersonalization);
googletag.pubads().enableAsyncRendering();
googletag.pubads().collapseEmptyDivs();
window.bizxPrebid.SAFEFRAMES = true;
bizxPrebid.Ads.pushToGoogle();
googletag.enableServices();
});
})();
</script>
<!-- CrossPixel -->
<script type="text/javascript"> try{(function(){ var cb = new Date().getTime(); var s = document.createElement("script"); s.defer = true; s.src = "//tag.crsspxl.com/s1.js?d=2397&cb="+cb; var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(s, s0); })();}catch(e){} </script>
<!-- AdBlock Check -->
<script>
var isAdBlockActive = true;
</script>
<script async src="//a.fsdn.com/sd/js/scripts/ad.js?0771f26796689b4c"></script>
</head>
<body class="anon index2 ">
<script src="//a.fsdn.com/sd/all-minified.js?0771f26796689b4c" type="text/javascript"></script>
<script type="text/javascript">
(function(){
var regexp=/\s*(?:\d+|many)\s+more\s*/i;
var auto_more_count = 1;
function auto_more(){
var $more_link = $('#more-experiment a');
$more_link.each(function(){
var $lastitem = $('#firehoselist>article.fhitem:visible:last');
if ( Bounds.intersect(window, $lastitem) ) {
!--auto_more_count && (auto_more=undefined);
// don't allow a call till the next paginate gets built and |more_possible|
$(document).unbind('scroll', call_auto_more);
}
});
};
function call_auto_more(){ auto_more && auto_more(); }
$('#more-experiment a').
live('more-possible', function( event ){
var $more_link=$(this);
if ( regexp.test($more_link.text()) ) {
$(document).bind('scroll', call_auto_more);
} else {
$(document).unbind('scroll', call_auto_more);
}
});
})();
</script>
<!--[if lt IE 9]><script src="//a.fsdn.com/sd/html5.js"></script><![endif]-->
<script type="text/javascript">
(function() {
if (typeof window.janrain !== 'object') window.janrain = {};
if (typeof window.janrain.settings !== 'object') window.janrain.settings = {};
/* _______________ can edit below this line _______________ */
janrain.settings.tokenUrl = 'https://slashdot.org/token_callback.pl';
janrain.settings.type = 'embed';
janrain.settings.appId = 'ggidemlconlmjciiohla';
janrain.settings.appUrl = 'https://login.slashdot.org';
janrain.settings.providers = [
'googleplus',
'facebook',
'twitter',
'linkedin'];
janrain.settings.providersPerPage = '5';
janrain.settings.format = 'one column';
janrain.settings.actionText = 'Sign in with';
janrain.settings.showAttribution = false;
janrain.settings.fontColor = '#666666';
janrain.settings.fontFamily = 'lucida grande, Helvetica, Verdana, sans-serif';
janrain.settings.backgroundColor = '#ffffff';
janrain.settings.width = '300';
janrain.settings.borderColor = '#cccccc';
janrain.settings.borderRadius = '5'; janrain.settings.buttonBorderColor = '#CCCCCC';
janrain.settings.buttonBorderRadius = '0';
janrain.settings.buttonBackgroundStyle = 'gray';
janrain.settings.language = '';
janrain.settings.linkClass = 'janrainEngage';
/* _______________ can edit above this line _______________ */
function isReady() { janrain.ready = true; };
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", isReady, false);
} else {
window.attachEvent('onload', isReady);
}
var e = document.createElement('script');
e.type = 'text/javascript';
e.id = 'janrainAuthWidget';
e.src = 'https://rpxnow.com/js/lib/login.slashdot.org/engage.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(e, s);
})();
</script>
<script src="//cdn-social.janrain.com/social/janrain-social.min.js"></script>
<script type="text/javascript">
(function($) {
$(function(){
janrain.settings.appUrl = "https://login.slashdot.org";
$twitter = $('body .janrain_twitterButton');