Created
November 19, 2020 14:53
-
-
Save Ebycow/16ed79e07402a086eed9af17cc9675aa to your computer and use it in GitHub Desktop.
NeosVR ゆかりねっと
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net'); | |
const ws = require('ws') | |
const wserver = new ws.Server({port:2783}, () => console.log("ws open on port 2783")) | |
wserver.on('connection', (socket) => { | |
console.log("Neos Client connected") | |
}); | |
const server = net.createServer(function(conn){ | |
conn.on('data', function(data){ | |
console.log("conn and recv data", data) | |
const text = data.slice(15).toString().slice(0,-1) | |
console.log(text) | |
conn.write("") | |
for (const client of wserver.clients) { | |
console.log("send!") | |
client.send(text) | |
} | |
}); | |
conn.on('error', (error) => { | |
console.error(error) | |
}); | |
conn.on('close', function(){ | |
console.log("conn successfully close") | |
}); | |
}).listen(50001); | |
console.log('listening on boyomi port 50001'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ゆかりねっとの「棒読みちゃん連携」を有効にしてください