{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1745566077,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"d6d7f63285df52067956763ba0dee866",
"oid":{ "oid": "7d22c297224306ebda9021ad352fdc80fd7080eb", "alias": []},"blobname": "test-server/test.html", "blob": "\u003c!DOCTYPE html\u003e\n\u003chtml lang\u003d\u0022en\u0022\u003e\n\u003chead\u003e\n \u003cmeta charset\u003dutf-8 http-equiv\u003d\u0022Content-Language\u0022 content\u003d\u0022en\u0022/\u003e\n \u003ctitle\u003eMinimal Websocket test app\u003c/title\u003e\n\u003cstyle type\u003d\u0022text/css\u0022\u003e\n\tspan.title { font-size:18pt; font: Arial; font-weight:normal; text-align:center; color:#000000; }\n\t.browser { font-size:18pt; font: Arial; font-weight:normal; text-align:center; color:#ffff00; vertical-align:middle; text-align:center; background:#d0b070; padding:12px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px;}\n\t.group2 { vertical-align:middle;\n\t\ttext-align:center;\n\t\tbackground:#f0f0e0; \n\t\tpadding:12px; \n\t\t-webkit-border-radius:10px; \n\t\t-moz-border-radius:10px;\n\t\tborder-radius:10px; }\n\t.explain { vertical-align:middle;\n\t\ttext-align:center;\n\t\tbackground:#f0f0c0; padding:12px;\n\t\t-webkit-border-radius:10px;\n\t\t-moz-border-radius:10px;\n\t\tborder-radius:10px;\n\t\tcolor:#404000; }\n\ttd.wsstatus { vertical-align:middle; width:200px; height:50px;\n\t\ttext-align:center;\n\t\tbackground:#f0f0c0; padding:6px;\n\t\t-webkit-border-radius:8px;\n\t\t-moz-border-radius:8px;\n\t\tborder-radius:8px;\n\t\tcolor:#404000; }\n\ttd.l { vertical-align:middle;\n\t\ttext-align:center;\n\t\tbackground:#d0d0b0; \n\t\tpadding:3px; \n\t\t-webkit-border-radius:3px; \n\t\t-moz-border-radius:3px;\n\t\tborder-radius:3px; }\n\t.content { vertical-align:top; text-align:center; background:#fffff0; padding:12px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; }\n\t.canvas { vertical-align:top; text-align:center; background:#efefd0; padding:12px; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px; }\n.tabs {\n position: relative; \n min-height: 750px; /* This part sucks */\n clear: both;\n margin: 25px 0;\n}\n.tab {\n float: left;\n}\n.tab label {\n background: #eee; \n padding: 10px; \n border: 1px solid #ccc; \n margin-left: -1px; \n position: relative;\n left: 1px; \n}\n.tab [type\u003dradio] {\n display: none; \n}\n.content {\n position: absolute;\n top: 28px;\n left: 0;\n background: white;\n right: 0;\n bottom: 0;\n padding: 20px;\n border: 1px solid #ccc; \n}\n[type\u003dradio]:checked ~ label {\n background: white;\n border-bottom: 1px solid white;\n z-index: 2;\n}\n[type\u003dradio]:checked ~ label ~ .content {\n z-index: 1;\n}\n\u003c/style\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\u003cheader\u003e\u003c/header\u003e\n\u003carticle\u003e\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n\u003ctable width\u003d600px\u003e\n \u003ctr\u003e\n \u003ctd valign\u003dmiddle align\u003dcenter\u003e\n \u003ca href\u003d\u0022https://libwebsockets.org\u0022\u003e\n \u003cimg src\u003d\u0022/libwebsockets.org-logo.png\u0022\u003e\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e\n\t\u003csection class\u003d\u0022browser\u0022\u003eDetected Browser: \n\t\u003cdiv id\u003dbrow\u003e...\u003c/div\u003e\u003c/section\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n\n\u003c/table\u003e\n\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd colspan\u003d2 align\u003dcenter\u003e\nClick \u003ca href\u003d\u0022/leaf.jpg\u0022 target\u003d\u0022_blank\u0022\u003eHere\u003c/a\u003e to\nhave the test server send a big picture by http.\n\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd colspan\u003d2\u003e\n\u003cdiv class\u003d\u0022tabs\u0022\u003e\n\n \u003cdiv class\u003d\u0022tab\u0022\u003e\n \u003cinput type\u003d\u0022radio\u0022 id\u003d\u0022tab-1\u0022 name\u003d\u0022tab-group-1\u0022 checked\u003e\n \u003clabel for\u003d\u0022tab-1\u0022\u003eDumb Increment Demo\u003c/label\u003e\n \n \u003cdiv class\u003d\u0022content\u0022\u003e\n \u003cdiv id\u003d\u0022dumb\u0022 class\u003d\u0022group2\u0022\u003e\n \u003ctable\u003e\n \u003ctr\u003e\n\t \u003ctd id\u003dwsdi_statustd align\u003dcenter class\u003d\u0022wsstatus\u0022\u003e\n\t \u003cspan id\u003dwsdi_status\u003eWebsocket connection not initialized\u003c/span\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cspan class\u003d\u0022title\u0022\u003edumb increment-protocol\u003c/span\u003e\u003c/td\u003e\n\t \u003c/tr\u003e\n\t \u003ctr\u003e\n\t \u003ctd class\u003d\u0022explain\u0022 colspan\u003d2\u003e\nThe incrementing number is coming from the server at 20Hz and is individual for\neach connection to the server... try opening a second browser window.\n\u003cbr/\u003e\u003cbr/\u003e\nThe button sends a message over the websocket link to ask the server\nto zero just this connection's number.\n\t \u003c/td\u003e\n\t \u003c/tr\u003e\n\t \u003ctr\u003e\n\t \u003ctd align\u003dcenter\u003e\u003cdiv id\u003dnumber style\u003d\u0022font-size:120%;\u0022\u003e \u003c/div\u003e\u003c/td\u003e\n\t \u003ctd align\u003dcenter\u003e\n\t \u003cinput type\u003dbutton id\u003doffset value\u003d\u0022Reset counter\u0022 onclick\u003d\u0022reset();\u0022 \u003e\n\t \u003c/td\u003e\n\t \u003c/tr\u003e\n\t \u003c/table\u003e\n\t\u003c/div\u003e\n \u003c/div\u003e \n \u003c/div\u003e\n\n \u003cdiv class\u003d\u0022tab\u0022\u003e\n \u003cinput type\u003d\u0022radio\u0022 id\u003d\u0022tab-2\u0022 name\u003d\u0022tab-group-1\u0022\u003e\n \u003clabel for\u003d\u0022tab-2\u0022\u003eMirror Demo\u003c/label\u003e\n \n \u003cdiv class\u003d\u0022content\u0022\u003e\n \u003cdiv id\u003d\u0022mirror\u0022 class\u003d\u0022group2\u0022\u003e\n \u003ctable\u003e\n \u003ctr\u003e\n\t \u003ctd colspan\u003d1 id\u003dwslm_statustd align\u003dcenter class\u003d\u0022wsstatus\u0022\u003e\n\t \u003cspan id\u003dwslm_status\u003eWebsocket connection not initialized\u003c/span\u003e\n\t\u003c/td\u003e\n \u003ctd\u003e\n \u003cspan class\u003d\u0022title\u0022\u003elws-mirror-protocol\u003c/span\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd colspan\u003d2\u003e\n \u003cdiv class\u003d\u0022explain\u0022\u003e\nUse the mouse to draw on the canvas below -- all other browser windows open\non this page see your drawing in realtime and you can see any of theirs as\nwell.\n\u003cbr/\u003e\u003cbr/\u003e\nThe lws-mirror protocol doesn't interpret what is being sent to it, it just\nre-sends it to every other websocket it has a connection with using that\nprotocol, including the guy who sent the packet.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003elibwebsockets-test-client\u003c/b\u003e joins in by spamming circles on to this shared canvas when\nrun.\n \u003c/div\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n\t\u003ctd colspan\u003d2\u003eDrawing color:\n\t \u003cselect id\u003d\u0022color\u0022 onchange\u003d\u0022update_color();\u0022\u003e\n\t\t\u003coption value\u003d#000000\u003eBlack\u003c/option\u003e\n\t\t\u003coption value\u003d#0000ff\u003eBlue\u003c/option\u003e\n\t\t\u003coption value\u003d#20ff20\u003eGreen\u003c/option\u003e\n\t\t\u003coption value\u003d#802020\u003eDark Red\u003c/option\u003e\n\t \u003c/select\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n\t \u003ctd colspan\u003d2 width\u003d500 height\u003d320\u003e\n\t\t\u003cdiv id\u003d\u0022wslm_drawing\u0022 style\u003d\u0022background:white\u0022\u003e\u003c/div\u003e\n\t\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003c/div\u003e \n \u003c/div\u003e\n \n \u003cdiv class\u003d\u0022tab\u0022\u003e\n \u003cinput type\u003d\u0022radio\u0022 id\u003d\u0022tab-3\u0022 name\u003d\u0022tab-group-1\u0022\u003e\n \u003clabel for\u003d\u0022tab-3\u0022\u003eClose Testing\u003c/label\u003e\n \n \u003cdiv class\u003d\u0022content\u0022\u003e\n\u003cdiv id\u003d\u0022ot\u0022 class\u003d\u0022group2\u0022\u003e\n \u003ctable\u003e\n \u003ctr\u003e\n \u003ctd\u003e\n\n\t\t\u003c/td\u003e\u003c/tr\u003e\n\t\t\u003ctr\u003e\u003ctd id\u003dot_statustd align\u003dcenter class\u003d\u0022wsstatus\u0022\u003e\n\t\t \u003cspan id\u003dot_status\u003eWebsocket connection not initialized\u003c/span\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd colspan\u003d2\u003e\u003cspan class\u003d\u0022title\u0022\u003eOpen and close testing\u003c/span\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\t\n\u003ctd class\u003d\u0022explain\u0022 colspan\u003d3 style\u003d\u0022padding:3\u0022\u003e\nTo help with open and close testing, you can open and close a connection by hand using\n the buttons.\u003cbr\u003e\n \u0022\u003cb\u003eClose\u003c/b\u003e\u0022 closes the connection from the browser with code 3000\n and reason 'Bye!\u0022.\u003cbr\u003e\n \u0022\u003cb\u003eRequest Server Close\u003c/b\u003e\u0022 sends a message asking the server to\ninitiate the close, which it does with code 1001 and reason \u0022Seeya\u0022.\n\u003c/td\u003e\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\u003ctd align\u003dcenter\u003e\u003cinput type\u003dbutton id\u003dot_open_btn value\u003d\u0022Open\u0022 onclick\u003d\u0022ot_open();\u0022 \u003e\u003c/td\u003e\n\t\t\u003ctd align\u003dcenter\u003e\u003cinput type\u003dbutton id\u003dot_close_btn disabled value\u003d\u0022Close\u0022 onclick\u003d\u0022ot_close();\u0022 \u003e\u003c/td\u003e\n\t\t\u003ctd align\u003dcenter\u003e\u003cinput type\u003dbutton id\u003dot_req_close_btn disabled value\u003d\u0022Request Server Close\u0022 onclick\u003d\u0022ot_req_close();\u0022 \u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003c/div\u003e\n \u003c/div\u003e \n \u003c/div\u003e\n \n \u003cdiv class\u003d\u0022tab\u0022\u003e\n \u003cinput type\u003d\u0022radio\u0022 id\u003d\u0022tab-4\u0022 name\u003d\u0022tab-group-1\u0022\u003e\n \u003clabel for\u003d\u0022tab-4\u0022\u003eServer info\u003c/label\u003e\n\n \u003cdiv class\u003d\u0022content\u0022\u003e\n\u003cdiv id\u003d\u0022ot\u0022 class\u003d\u0022group2\u0022\u003e\n \u003ctable\u003e\n \u003ctr\u003e\n\t\u003ctd id\u003ds_statustd align\u003dcenter class\u003d\u0022wsstatus\u0022\u003e\n\t \u003cdiv id\u003ds_status\u003eWebsocket connection not initialized\u003c/div\u003e\n\t\u003c/td\u003e\n\t \u003ctd colspan\u003d1\u003e\n\u003cspan class\u003d\u0022title\u0022\u003eServer Info\u003c/span\u003e\n\t\u003c/td\u003e\n\t\u003c/tr\u003e\u003ctr\u003e\n\u003ctd class\u003d\u0022explain\u0022 colspan\u003d2\u003e\nThis information is sent by the server over a ws[s] link and updated live\nwhenever the information changes server-side.\n\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\u003ctd align\u003dcenter colspan\u003d2\u003e\u003cdiv id\u003dservinfo\u003e\u003c/\u003c/div\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\u003ctd align\u003dcenter colspan\u003d2\u003e\u003cdiv id\u003dconninfo style\u003d\u0022border : solid 2px #e0d040; padding : 4px; width : 500px; height : 350px; overflow : auto; \u0022\u003e\u003c/\u003c/div\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n \u003c/div\u003e \n \u003c/div\u003e\n\n\u003c/div\u003e\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nLooking for support? \u003ca href\u003d\u0022https://libwebsockets.org\u0022\u003ehttps://libwebsockets.org\u003c/a\u003e, \u003ca href\u003d\u0022https://github.com/warmcat/libwebsockets\u0022\u003ehttps://github.com/warmcat/libwebsockets\u003c/a\u003e\u003c/a\u003e\u003cbr/\u003e\nJoin the mailing list: \u003ca href\u003d\u0022https://libwebsockets.org/mailman/listinfo/libwebsockets\u0022\u003ehttps://libwebsockets.org/mailman/listinfo/libwebsockets\u003c/a\u003e\n\n\u003c/article\u003e\n\n\u003cscript\u003e\n\n/*\n * We display untrusted stuff in html context... reject anything\n * that has HTML stuff in it\n */\n\nfunction san(s)\n{\n\tif (s.search(\u0022\u003c\u0022) !\u003d -1)\n\t\treturn \u0022invalid string\u0022;\n\t\n\treturn s;\n}\n\n/* BrowserDetect came from http://www.quirksmode.org/js/detect.html */\n\nvar BrowserDetect \u003d {\n\tinit: function () {\n\t\tthis.browser \u003d this.searchString(this.dataBrowser) || \u0022An unknown browser\u0022;\n\t\tthis.version \u003d this.searchVersion(navigator.userAgent)\n\t\t\t|| this.searchVersion(navigator.appVersion)\n\t\t\t|| \u0022an unknown version\u0022;\n\t\tthis.OS \u003d this.searchString(this.dataOS) || \u0022an unknown OS\u0022;\n\t},\n\tsearchString: function (data) {\n\t\tfor (var i\u003d0;i\u003cdata.length;i++)\t{\n\t\t\tvar dataString \u003d data[i].string;\n\t\t\tvar dataProp \u003d data[i].prop;\n\t\t\tthis.versionSearchString \u003d data[i].versionSearch || data[i].identity;\n\t\t\tif (dataString) {\n\t\t\t\tif (dataString.indexOf(data[i].subString) !\u003d -1)\n\t\t\t\t\treturn data[i].identity;\n\t\t\t}\n\t\t\telse if (dataProp)\n\t\t\t\treturn data[i].identity;\n\t\t}\n\t},\n\tsearchVersion: function (dataString) {\n\t\tvar index \u003d dataString.indexOf(this.versionSearchString);\n\t\tif (index \u003d\u003d -1) return;\n\t\treturn parseFloat(dataString.substring(index+this.versionSearchString.length+1));\n\t},\n\tdataBrowser: [\n\t\t{\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022Chrome\u0022,\n\t\t\tidentity: \u0022Chrome\u0022\n\t\t},\n\t\t{ \tstring: navigator.userAgent,\n\t\t\tsubString: \u0022OmniWeb\u0022,\n\t\t\tversionSearch: \u0022OmniWeb/\u0022,\n\t\t\tidentity: \u0022OmniWeb\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.vendor,\n\t\t\tsubString: \u0022Apple\u0022,\n\t\t\tidentity: \u0022Safari\u0022,\n\t\t\tversionSearch: \u0022Version\u0022\n\t\t},\n\t\t{\n\t\t\tprop: window.opera,\n\t\t\tidentity: \u0022Opera\u0022,\n\t\t\tversionSearch: \u0022Version\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.vendor,\n\t\t\tsubString: \u0022iCab\u0022,\n\t\t\tidentity: \u0022iCab\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.vendor,\n\t\t\tsubString: \u0022KDE\u0022,\n\t\t\tidentity: \u0022Konqueror\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022Firefox\u0022,\n\t\t\tidentity: \u0022Firefox\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.vendor,\n\t\t\tsubString: \u0022Camino\u0022,\n\t\t\tidentity: \u0022Camino\u0022\n\t\t},\n\t\t{\t\t// for newer Netscapes (6+)\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022Netscape\u0022,\n\t\t\tidentity: \u0022Netscape\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022MSIE\u0022,\n\t\t\tidentity: \u0022Explorer\u0022,\n\t\t\tversionSearch: \u0022MSIE\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022Gecko\u0022,\n\t\t\tidentity: \u0022Mozilla\u0022,\n\t\t\tversionSearch: \u0022rv\u0022\n\t\t},\n\t\t{ \t\t// for older Netscapes (4-)\n\t\t\tstring: navigator.userAgent,\n\t\t\tsubString: \u0022Mozilla\u0022,\n\t\t\tidentity: \u0022Netscape\u0022,\n\t\t\tversionSearch: \u0022Mozilla\u0022\n\t\t}\n\t],\n\tdataOS : [\n\t\t{\n\t\t\tstring: navigator.platform,\n\t\t\tsubString: \u0022Win\u0022,\n\t\t\tidentity: \u0022Windows\u0022\n\t\t},\n\t\t{\n\t\t\tstring: navigator.platform,\n\t\t\tsubString: \u0022Mac\u0022,\n\t\t\tidentity: \u0022Mac\u0022\n\t\t},\n\t\t{\n\t\t\t string: navigator.userAgent,\n\t\t\t subString: \u0022iPhone\u0022,\n\t\t\t identity: \u0022iPhone/iPod\u0022\n\t },\n\t\t{\n\t\t\tstring: navigator.platform,\n\t\t\tsubString: \u0022Linux\u0022,\n\t\t\tidentity: \u0022Linux\u0022\n\t\t}\n\t]\n\n};\nBrowserDetect.init();\n\ndocument.getElementById(\u0022brow\u0022).textContent \u003d \u0022 \u0022 + BrowserDetect.browser + \u0022 \u0022\n\t+ BrowserDetect.version +\u0022 \u0022 + BrowserDetect.OS +\u0022 \u0022;\n\n\tvar pos \u003d 0;\n\nfunction get_appropriate_ws_url()\n{\n\tvar pcol;\n\tvar u \u003d document.URL;\n\n\t/*\n\t * We open the websocket encrypted if this page came on an\n\t * https:// url itself, otherwise unencrypted\n\t */\n\n\tif (u.substring(0, 5) \u003d\u003d \u0022https\u0022) {\n\t\tpcol \u003d \u0022wss://\u0022;\n\t\tu \u003d u.substr(8);\n\t} else {\n\t\tpcol \u003d \u0022ws://\u0022;\n\t\tif (u.substring(0, 4) \u003d\u003d \u0022http\u0022)\n\t\t\tu \u003d u.substr(7);\n\t}\n\n\tu \u003d u.split('/');\n\n\t/* + \u0022/xxx\u0022 bit is for IE10 workaround */\n\n\treturn pcol + u[0] + \u0022/xxx\u0022;\n}\n\n\ndocument.getElementById(\u0022number\u0022).textContent \u003d get_appropriate_ws_url();\n\n/* dumb increment protocol */\n\t\n\tvar socket_di;\n\n\tif (typeof MozWebSocket !\u003d \u0022undefined\u0022) {\n\t\tsocket_di \u003d new MozWebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022dumb-increment-protocol\u0022);\n\t} else {\n\t\tsocket_di \u003d new WebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022dumb-increment-protocol\u0022);\n\t}\n\n\n\ttry {\n\t\tsocket_di.onopen \u003d function() {\n\t\t\tdocument.getElementById(\u0022wsdi_statustd\u0022).style.backgroundColor \u003d \u0022#40ff40\u0022;\n\t\t\tdocument.getElementById(\u0022wsdi_status\u0022).innerHTML \u003d\n\t\t\t\t\u0022 \u003cb\u003ewebsocket connection opened\u003c/b\u003e\u003cbr\u003e\u0022 +\n\t\t\t\tsan(socket_di.extensions);\n\t\t} \n\n\t\tsocket_di.onmessage \u003dfunction got_packet(msg) {\n\t\t\tdocument.getElementById(\u0022number\u0022).textContent \u003d msg.data + \u0022\u005cn\u0022;\n\t\t} \n\n\t\tsocket_di.onclose \u003d function(){\n\t\t\tdocument.getElementById(\u0022wsdi_statustd\u0022).style.backgroundColor \u003d \u0022#ff4040\u0022;\n\t\t\tdocument.getElementById(\u0022wsdi_status\u0022).textContent \u003d \u0022 websocket connection CLOSED \u0022;\n\t\t}\n\t} catch(exception) {\n\t\talert('\u003cp\u003eError' + exception); \n\t}\n\t\n\tvar socket_status, jso, s;\n\n\tif (typeof MozWebSocket !\u003d \u0022undefined\u0022) {\n\t\tsocket_status \u003d new MozWebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022lws-status\u0022);\n\t} else {\n\t\tsocket_status \u003d new WebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022lws-status\u0022);\n\t}\n\n\n\ttry {\n\t\tsocket_status.onopen \u003d function() {\n\t\t\tdocument.getElementById(\u0022s_statustd\u0022).style.backgroundColor \u003d \u0022#40ff40\u0022;\n\t\t\tdocument.getElementById(\u0022s_status\u0022).innerHTML \u003d\n\t\t\t\t\u0022 \u003cb\u003ewebsocket connection opened\u003c/b\u003e\u003cbr\u003e\u0022 +\n\t\t\t\tsan(socket_di.extensions);\n\t\t} \n\n\t\tsocket_status.onmessage \u003dfunction got_packet(msg) {\n\t\t\tjso \u003d JSON.parse(msg.data);\n\t\t\t\n\t\t\tdocument.getElementById(\u0022servinfo\u0022).innerHTML \u003d \n\t\t\t\t\u0022\u003ctable\u003e\u003ctr\u003e\u003ctd class\u003dl\u003eBuild info\u003c/td\u003e\u003ctd\u003e\u0022+\n\t\t\t\t\tsan(jso.version) + \u0022\u003c/td\u003e\u003c/tr\u003e\u0022 +\n\t\t\t\t\t\u0022\u003ctr\u003e\u003ctd class\u003dl\u003eServer info\u003c/td\u003e\u003ctd\u003e\u0022 +\n\t\t\t\t\tsan(jso.hostname) + \u0022\u003c/td\u003e\u003c/tr\u003e\u0022 +\n\t\t\t\t\t\u0022\u003c/table\u003e\u0022;\n\t\t\ts\u003d\u0022\u003ctable\u003e\u0022;\n\t\t\tvar n;\n\t\t\tfor (n \u003d 0; n \u003c jso.conns.length; n++)\n\t\t\t\ts \u003d s + \u0022\u003ctr\u003e\u003ctd class\u003dl\u003eclient \u0022 + (n + 1) +\n\t\t\t\t\u0022\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u0022 + san(jso.conns[n].peer) +\n\t\t\t\t\u0022\u003c/b\u003e\u003cbr\u003e\u0022 + san(jso.conns[n].time) +\n\t\t\t\t\u0022\u003cbr\u003e\u0022 + san(jso.conns[n].ua) +\n\t\t\t\t\u0022\u003c/td\u003e\u003c/tr\u003e\u0022;\n\t\t\ts \u003d s + \u0022\u003c/table\u003e\u0022;\n\t\t\t\n\t\t\tdocument.getElementById(\u0022conninfo\u0022).innerHTML \u003d s;\n\t\t} \n\n\t\tsocket_status.onclose \u003d function(){\n\t\t\tdocument.getElementById(\u0022s_statustd\u0022).style.backgroundColor \u003d \u0022#ff4040\u0022;\n\t\t\tdocument.getElementById(\u0022s_status\u0022).textContent \u003d \u0022 websocket connection CLOSED \u0022;\n\t\t}\n\t} catch(exception) {\n\t\talert('\u003cp\u003eError' + exception); \n\t}\n\nfunction reset() {\n\tsocket_di.send(\u0022reset\u005cn\u0022);\n}\n\nvar socket_ot;\n\nfunction ot_open() {\n\tif (typeof MozWebSocket !\u003d \u0022undefined\u0022) {\n\t\tsocket_ot \u003d new MozWebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022dumb-increment-protocol\u0022);\n\t} else {\n\t\tsocket_ot \u003d new WebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022dumb-increment-protocol\u0022);\n\t}\n\ttry {\n\t\tsocket_ot.onopen \u003d function() {\n\t\t\tdocument.getElementById(\u0022ot_statustd\u0022).style.backgroundColor \u003d \u0022#40ff40\u0022;\n\t\t\tdocument.getElementById(\u0022ot_status\u0022).innerHTML \u003d \u0022 \u003cb\u003ewebsocket connection opened\u003c/b\u003e\u003cbr\u003e\u0022 + san(socket_di.extensions);\n\t\t\tdocument.getElementById(\u0022ot_open_btn\u0022).disabled \u003d true;\n\t\t\tdocument.getElementById(\u0022ot_close_btn\u0022).disabled \u003d false;\n\t\t\tdocument.getElementById(\u0022ot_req_close_btn\u0022).disabled \u003d false;\n\t\t} \n\n\t\tsocket_ot.onclose \u003d function(e){\n\t\t\tdocument.getElementById(\u0022ot_statustd\u0022).style.backgroundColor \u003d \u0022#ff4040\u0022;\n\t\t\tdocument.getElementById(\u0022ot_status\u0022).textContent \u003d \u0022 websocket connection CLOSED, code: \u0022 + e.code +\n\t\t\t\u0022, reason: \u0022 + e.reason;\n\t\t\tdocument.getElementById(\u0022ot_open_btn\u0022).disabled \u003d false;\n\t\t\tdocument.getElementById(\u0022ot_close_btn\u0022).disabled \u003d true;\n\t\t\tdocument.getElementById(\u0022ot_req_close_btn\u0022).disabled \u003d true;\n\t\t}\n\t} catch(exception) {\n\t\talert('\u003cp\u003eError' + exception); \n\t}\n}\n\n/* browser will close the ws in a controlled way */\nfunction ot_close() {\n\tsocket_ot.close(3000, \u0022Bye!\u0022);\n}\n\n/* we ask the server to close the ws in a controlled way */\nfunction ot_req_close() {\n\tsocket_ot.send(\u0022closeme\u005cn\u0022);\n}\n\n/* lws-mirror protocol */\n\n\tvar down \u003d 0;\n\tvar no_last \u003d 1;\n\tvar last_x \u003d 0, last_y \u003d 0;\n\tvar ctx;\n\tvar socket_lm;\n\tvar color \u003d \u0022#000000\u0022;\n\n\tif (typeof MozWebSocket !\u003d \u0022undefined\u0022) {\n\t\tsocket_lm \u003d new MozWebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022lws-mirror-protocol\u0022);\n\t} else {\n\t\tsocket_lm \u003d new WebSocket(get_appropriate_ws_url(),\n\t\t\t\t \u0022lws-mirror-protocol\u0022);\n\t}\n\n\n\ttry {\n\t\tsocket_lm.onopen \u003d function() {\n\t\t\tdocument.getElementById(\u0022wslm_statustd\u0022).style.backgroundColor \u003d \u0022#40ff40\u0022;\n\t\t\tdocument.getElementById(\u0022wslm_status\u0022).innerHTML \u003d\n\t\t\t\t\u0022 \u003cb\u003ewebsocket connection opened\u003c/b\u003e\u003cbr\u003e\u0022 +\n\t\t\t\tsan(socket_di.extensions);\n\t\t} \n\n\t\tsocket_lm.onmessage \u003dfunction got_packet(msg) {\n\t\t\tj \u003d msg.data.split(';');\n\t\t\tf \u003d 0;\n\t\t\twhile (f \u003c j.length - 1) {\n\t\t\t\ti \u003d j[f].split(' ');\n\t\t\t\tif (i[0] \u003d\u003d 'd') {\n\t\t\t\t\tctx.strokeStyle \u003d i[1];\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(+(i[2]), +(i[3]));\n\t\t\t\t\tctx.lineTo(+(i[4]), +(i[5]));\n\t\t\t\t\tctx.stroke();\n\t\t\t\t}\n\t\t\t\tif (i[0] \u003d\u003d 'c') {\n\t\t\t\t\tctx.strokeStyle \u003d i[1];\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(+(i[2]), +(i[3]), +(i[4]), 0, Math.PI*2, true); \n\t\t\t\t\tctx.stroke();\n\t\t\t\t}\n\n\t\t\t\tf++;\n\t\t\t}\n\t\t}\n\n\t\tsocket_lm.onclose \u003d function(){\n\t\t\tdocument.getElementById(\u0022wslm_statustd\u0022).style.backgroundColor \u003d \u0022#ff4040\u0022;\n\t\t\tdocument.getElementById(\u0022wslm_status\u0022).textContent \u003d \u0022 websocket connection CLOSED \u0022;\n\t\t}\n\t} catch(exception) {\n\t\talert('\u003cp\u003eError' + exception); \n\t}\n\n\tvar canvas \u003d document.createElement('canvas');\n\tcanvas.height \u003d 300;\n\tcanvas.width \u003d 480;\n\tctx \u003d canvas.getContext(\u00222d\u0022);\n\n\tdocument.getElementById('wslm_drawing').appendChild(canvas);\n\n\tcanvas.addEventListener('mousemove', ev_mousemove, false);\n\tcanvas.addEventListener('mousedown', ev_mousedown, false);\n\tcanvas.addEventListener('mouseup', ev_mouseup, false);\n\n\toffsetX \u003d offsetY \u003d 0;\n\telement \u003d canvas;\n if (element.offsetParent) {\n do {\n offsetX +\u003d element.offsetLeft;\n offsetY +\u003d element.offsetTop;\n } while ((element \u003d element.offsetParent));\n }\n \nfunction update_color() {\n\tcolor \u003d document.getElementById(\u0022color\u0022).value;\n}\n\nfunction ev_mousedown (ev) {\n\tdown \u003d 1;\n}\n\nfunction ev_mouseup(ev) {\n\tdown \u003d 0;\n\tno_last \u003d 1;\n}\n\nfunction ev_mousemove (ev) {\n\tvar x, y;\n\n\tif (ev.offsetX) {\n\t\tx \u003d ev.offsetX;\n\t\ty \u003d ev.offsetY;\n\t} else {\n\t\tx \u003d ev.layerX - offsetX;\n\t\ty \u003d ev.layerY - offsetY;\n\n\t}\n\n\tif (!down)\n\t\treturn;\n\tif (no_last) {\n\t\tno_last \u003d 0;\n\t\tlast_x \u003d x;\n\t\tlast_y \u003d y;\n\t\treturn;\n\t}\n\tsocket_lm.send(\u0022d \u0022 + color + \u0022 \u0022 + last_x + \u0022 \u0022 + last_y + \u0022 \u0022 + x + ' ' + y + ';');\n\n\tlast_x \u003d x;\n\tlast_y \u003d y;\n}\n\n\n\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n","s":{"c":1745566077,"u": 1660}}
],"g": 5430,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}