* Refactor socket preencoding and encoding to use socketEncoding when _server is defined.

This commit is contained in:
Derrick Hammer 2023-04-16 17:34:42 -04:00
parent f3e5cebe45
commit ec937e786b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -199,8 +199,8 @@ export default class MultiSocketProxy extends Proxy {
const self = this; const self = this;
const message = await peer.channel.addMessage({ const message = await peer.channel.addMessage({
encoding: { encoding: {
preencode: json.preencode, preencode: this._server ? socketEncoding.preencode : json.preencode,
encode: json.encode, encode: this._server ? socketEncoding.encode : json.encode,
decode: this._server ? json.decode : socketEncoding.decode, decode: this._server ? json.decode : socketEncoding.decode,
}, },
async onmessage(m: SocketRequest | TcpSocketConnectOpts) { async onmessage(m: SocketRequest | TcpSocketConnectOpts) {