From 4099949984eb80ef33c2d0dd216991124975a5d2 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 28 Jan 2017 14:50:48 +0100 Subject: Remove Base64 support This is an older protocol used before browsers got native support for Websockets. --- tests/b64_vs_utf8.py | 29 ---------------- tests/base64.html | 91 --------------------------------------------------- tests/base64.js | 12 ------- tests/echo.html | 1 - tests/latency.html | 1 - tests/load.html | 1 - tests/plain_echo.html | 2 +- tests/simple.html | 1 - tests/utf8-list.py | 19 ----------- 9 files changed, 1 insertion(+), 156 deletions(-) delete mode 100755 tests/b64_vs_utf8.py delete mode 100644 tests/base64.html delete mode 100644 tests/base64.js delete mode 100755 tests/utf8-list.py (limited to 'tests') diff --git a/tests/b64_vs_utf8.py b/tests/b64_vs_utf8.py deleted file mode 100755 index 9af7b62..0000000 --- a/tests/b64_vs_utf8.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -from base64 import b64encode, b64decode -from codecs import (utf_8_encode, utf_8_decode, - latin_1_encode, latin_1_decode) -import random, time - -buf_len = 10000 -iterations = 10000 - -print "Generating random input buffer" -r = random.Random() -buf = "".join([chr(r.randint(0, 255)) for i in range(buf_len)]) - -tests = {'UTF8 encode': lambda: utf_8_encode(unicode(buf, 'latin-1'))[0], - 'B64 encode': lambda: b64encode(buf)} -utf8_buf = tests['UTF8 encode']() -b64_buf = tests['B64 encode']() -tests.update({'UTF8 decode': lambda: latin_1_encode(utf_8_decode(utf8_buf)[0])[0], - 'B64 decode': lambda: b64decode(b64_buf)}) - -print "Running tests" -for test in 'UTF8 encode', 'B64 encode', 'UTF8 decode', 'B64 decode': - start = time.time() - for i in range(iterations): - res_buf = tests[test]() - print "%s took %s seconds (result size %s)" % ( - test, (time.time() - start), len(res_buf)) - diff --git a/tests/base64.html b/tests/base64.html deleted file mode 100644 index 24ad80b..0000000 --- a/tests/base64.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - Native Base64 Tests - - - - - -

Native Base64 Tests

- -
- Messages:
- - -
- - - diff --git a/tests/base64.js b/tests/base64.js deleted file mode 100644 index 6ade00a..0000000 --- a/tests/base64.js +++ /dev/null @@ -1,12 +0,0 @@ -// The following results in 'hello [MANGLED]' -// -// Filed as https://github.com/ry/node/issues/issue/402 - -var sys = require("sys"), - buf = new Buffer(1024), len, - str1 = "aGVsbG8g", // 'hello ' - str2 = "d29ybGQ=", // 'world' - -len = buf.write(str1, 0, 'base64'); -len += buf.write(str2, len, 'base64'); -sys.log("decoded result: " + buf.toString('binary', 0, len)); diff --git a/tests/echo.html b/tests/echo.html index cc8b642..8cc7ecb 100644 --- a/tests/echo.html +++ b/tests/echo.html @@ -4,7 +4,6 @@ WebSockets Echo Test -