1
0
forked from dyf/APP
revert Merge branch 'main' of http://47.107.152.87:3000/liubiao/APP

# Conflicts:
#	.gitignore
#	pages/common/index/index.vue
#	unpackage/dist/dev/app-plus/app-config-service.js
#	unpackage/dist/dev/app-plus/app-service.js
#	unpackage/dist/dev/app-plus/app-view.js
#	unpackage/dist/dev/app-plus/manifest.json
#	utils/request.js
This commit is contained in:
2025-07-31 10:59:29 +08:00
parent e5e2aca0c4
commit 70651b81f5
1387 changed files with 102695 additions and 5024 deletions

74
node_modules/websocket-stream/test-client.js generated vendored Normal file
View File

@ -0,0 +1,74 @@
var ws = require('./')
var test = require('tape')
var Buffer = require('safe-buffer').Buffer
test('echo works', function(t) {
var stream = ws('ws://localhost:8343')
stream.on('data', function(o) {
t.ok(Buffer.isBuffer(o), 'is buffer')
t.equal(o.toString(), 'hello', 'got hello back')
stream.destroy()
t.end()
})
stream.write(Buffer.from('hello'))
})
test('echo works two times', function(t) {
var stream = ws('ws://localhost:8343')
stream.once('data', function(o) {
t.equal(o.toString(), 'hello', 'got first hello back')
stream.write(Buffer.from('hello'))
stream.once('data', function(o) {
t.equal(o.toString(), 'hello', 'got second hello back')
stream.destroy()
t.end()
})
})
stream.write(Buffer.from('hello'))
})
test('with bare WebSocket, strings as strings', function (t) {
var socket = new WebSocket('ws://localhost:8344')
socket.onmessage = function (e) {
var data = e.data
t.ok(typeof data === 'string', 'data must be a string')
socket.close()
t.end()
}
})
test('with bare WebSocket, binary only', function (t) {
var socket = new WebSocket('ws://localhost:8345')
socket.onmessage = function (e) {
var data = e.data
t.notOk(typeof data === 'string', 'data must not be a string')
socket.close()
t.end()
}
})
test('coerce client data as binary', function(t) {
var stream = ws('ws://localhost:8346', { binary: true })
stream.on('data', function(o) {
t.ok(Buffer.isBuffer(o), 'is buffer')
t.equal(o.toString(), 'success', 'success!')
stream.destroy()
t.end()
})
stream.write('hello')
})
test('cork logic test', function (t) {
var stream = ws('ws://localhost:8343', { binary: true })
stream.on('data', function(o) {
t.equal(o.toString(), 'hello', 'success!')
stream.destroy()
t.end()
})
stream.cork()
stream.write('he')
stream.write('l')
stream.write('lo')
stream.uncork()
})