GithubHelp home page GithubHelp logo

three-letter / erlang-websocket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lujiajing1126/erlang-websocket

0.0 1.0 0.0 59 KB

An Light-Weight WebSocket Server written in Erlang

Erlang 100.00%

erlang-websocket's Introduction

Erlang WebSocket

Websocket Protocol

HandShake:

Step One:

<<"GET / HTTP/1.1\r\n
Host: localhost:12345\r\n
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3\r\n
Accept-Encoding: gzip, deflate\r\n
Sec-WebSocket-Version: 13\r\nOrigin: null\r\n
Sec-WebSocket-Key: QbGS1EqgNlt+T16EbWS9Mg==\r\n
Connection: keep-alive, Upgrade\r\n
Pragma: no-cache\r\n
Cache-Control: no-cache\r\n
Upgrade: websocket">>

Step Two:

<<"HTTP/1.1 101 Switching Protocols\r\n">>,
<<"Upgrade: websocket\r\n">>,
<<"Connection: Upgrade\r\n">>,
<<"Sec-WebSocket-Accept: ">>, Base64, <<"\r\n">>,
<<"\r\n">>

Which Base64 is the result of Sha1 = crypto:hash(sha,[SecWebSocketKey, <<"258EAFA5-E914-47DA-95CA-C5AB0DC85B11">>]) in BASE64

erlang-websocket's People

Contributors

lujiajing1126 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.