node.js로 websocket 셋업
2021. 10. 31. 23:14
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
WS https://www.npmjs.com/package/ws ws Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js www.npmjs.com 라이브러리 설치 npm i ws websocket과 http 동시에 연결하기 import http from 'http'; import WebSocket from 'ws'; const handleListen = () => console.log("Listening on http://localhost:3000"); const server = http.createServer(app) const wss = new WebSocket.Server({server}) ..

webSocket 과 http의 차이
2021. 10. 31. 22:48
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
http 프로토콜 표기 방식 http://google.com http는 클라이언트에 요청에 따라 서버가 수동적으로 반응함 http는 특징 중 하나는 stateless 이다 따라서 request와 response 후에 백엔드는 유저를 기억하지 못한다. 따라서 프로필 화면을 보고싶으면 쿠키를 서버에게 보내야 한다. 그래야 서버가 일치하는 프로필을 response 해준다 서버는 응답만 해준다. 그리고 응답 후 누가 request 했는지 잊는다. 브라우저는 request, 백엔드는 response만 가능 연결(http) 1.브라운저 - 백엔드 2.백엔드 - 백엔드 websocket 프로토콜 표기 방식 wss://google.com 클라이언트가 서버에게 websocket request 보냄 -> 서버가 accep..

Python 가상환경 실행(pipenv 이용), Django install
2021. 10. 11. 18:22
Backend 언어 및 프레임워크/Python - Django,Flask
터미널창에 파이썬3를 실행하기 위해 아래 명령어 pipenv --three 가상환경으로 실행 pipenv shell 가상환경 실행 확인 django-admin 나가기 exit Django install 최신 버전 pipeven install Django 특정 버전 pipenv install Django==2.2.5