mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 14:19:20 +02:00
Use ArrayBuffer in WS browser dialer binaryType (#3468)
On my machine, browserdialer speedtest gives 10 Mbit/s download. Now it can do 300 Mbit/s.
This commit is contained in:
parent
028a640b1b
commit
eb4f9429e6
|
@ -14,6 +14,9 @@
|
||||||
count += 1
|
count += 1
|
||||||
console.log("Prepare", url)
|
console.log("Prepare", url)
|
||||||
var ws = new WebSocket(url)
|
var ws = new WebSocket(url)
|
||||||
|
// arraybuffer is significantly faster in chrome than default
|
||||||
|
// blob, tested with chrome 123
|
||||||
|
ws.binaryType = "arraybuffer";
|
||||||
var wss = undefined
|
var wss = undefined
|
||||||
var first = true
|
var first = true
|
||||||
ws.onmessage = function (event) {
|
ws.onmessage = function (event) {
|
||||||
|
@ -23,6 +26,7 @@
|
||||||
var arr = event.data.split(" ")
|
var arr = event.data.split(" ")
|
||||||
console.log("Dial", arr[0], arr[1])
|
console.log("Dial", arr[0], arr[1])
|
||||||
wss = new WebSocket(arr[0], arr[1])
|
wss = new WebSocket(arr[0], arr[1])
|
||||||
|
wss.binaryType = "arraybuffer";
|
||||||
var opened = false
|
var opened = false
|
||||||
wss.onopen = function (event) {
|
wss.onopen = function (event) {
|
||||||
opened = true
|
opened = true
|
||||||
|
|
Loading…
Reference in New Issue