websocket

·네트워크
기존 HTTP 요청은 클라이언트에서 서버로 요청을 보내고 응답을 받는 프로토콜 서버에서 요청없이 응답을 보낼 수가 없었다. 또한 실시간 데이터 전송이 가능하다. 이를 웹소켓은 가능하게 할 수 있다. socket.html socket.js const http = require('http'); const { WebSocketServer } = require('ws'); const fs = require('fs').promises; const path = require('path'); const server = http.createServer(async (req, res) => { const data = await fs.readFile(path.join(__dirname, 'socket.html')); res..
king_hd
'websocket' 태그의 글 목록