Tag:websocket

  • Using go language to build websocket server

    Time:2020-3-30

    Go to build a simple websocket server code example test.go, as follows: package main import ( “fmt” “log” “net/http” “golang.org/x/net/websocket” ) func Echo(ws *websocket.Conn) { var err error for { var reply string if err = websocket.Message.Receive(ws, &reply); err != nil { fmt.Println(“Can’t receive”) break } fmt.Println(“Received back from client: ” + reply) msg := […]

  • Spring boot socket application

    Time:2020-2-2

    Preface This paper simply summarizes the application of broadcast stmop protocolUsing websocket (network socket)It is equivalent to discarding HTTP protocol and communicating directly with socketWe know that socket needs server and clientIn broadcast applications, a client sends information to the serverThe server turns on circular monitoring, and responds to all clients when receiving information requestsThis […]

  • Never learn Ajax again! (3) Get resources across domains ③ – websocket & PostMessage

    Time:2020-1-31

    Let’s briefly review what we talked about before. AJAX is aHybrid technology of acquiring server resources without page refresh。 Based on the browser’s “same origin policy”, AJAX requests cannot be sent between different “domains”. But in some situations, we need to “cross domain access to resources”. To meet this demand, we can use “jsonp” and […]

  • Building web SIP Phone Based on webrtc

    Time:2020-1-30

    0 notice before reading This article is not a tutorial, just a solution I just think about this problem from the web side. Actually, I need the cooperation of the back-end SIP server Jssip has a very good online demo. Where can I play? Try jssip 1. Technical introduction WebRTC: webrtc, name fromWeb im(English: Web […]

  • Personal blog development series: real time saving of articles

    Time:2020-1-29

    Preface Generally, the website used for writing has a function of editing and saving in real time. It is a very practical function for users. As a personal blog, although the use is not so obvious, but still want to achieve this function, it should be practice. Implementation ideas UseWebSocketTo carry out real-time communication between […]

  • Using node to implement simple websocket protocol

    Time:2020-1-28

    Using node to implement simple websocket protocol Starting from browser websocket API The websocket API provided by the browser is very simple. Let WS = new websocket (‘WS: // localhost: 8124 ‘) // create connection WS. Onopen = function (E) {…} // callback when the connection is established Ws.onmessage = function (E) {…} // callback […]

  • Solution of nginx reverse proxy websocket response 403

    Time:2020-1-27

    When nginx reverse proxy a spring web program (source code address) with websocket function, it is found that 403 responses always appear when accessing websocket interface. The configuration of nginx refers to the official document: http { //SSL related configuration map $http_upgrade $connection_upgrade { default upgrade; ” close; } server { listen 8020; location /ws […]

  • Websocket: 5 minutes from entry to mastery

    Time:2020-1-26

    1、 Content overview With the appearance of websocket, browser has the ability of real-time two-way communication. This paper introduces how websocket establishes the connection, exchanges the details of data, and the format of data frame. In addition, it briefly introduces the security attacks against websocket and how the protocol resists similar attacks. 2、 What is […]

  • Session management based on a fun chat room understanding applet

    Time:2020-1-25

    panda-chat-room Websocket chat for small programs. Basic tutorial on configuration from server to applet client. In this tutorial, we will implement a basic websocket chat room in the applet, and plan to implement the following functions: Wechat users log in to “applet session management” Text communication between users “websocket implementation” “File storage and related logic” […]

  • Nginx configures the reverse proxy of websocket

    Time:2020-1-24

    Because there are cross domain problems in general, cross domain configuration is directly carried out as well. For details of nginx cross domain configuration, please refer to my previous article: nginx cross domain configuration request Reverse proxy configuration of websocket: Direct post code: server { Listen 9000; listen to 9000 port server_name websocket_server; #Allow cross […]

  • Websocket of JavaScript server push technology

    Time:2020-1-23

    Recently, I met a scenario that requires the server to push messages in my work. Here is a summary of the harvest of collecting and sorting out websocket related data. 1. overview 1.1 server push WebSocketAs a communication protocol, it belongs to a kind of server push technology, supported by ie10 +. There are more […]

  • Spring boot + websocket to realize online chat (1)

    Time:2020-1-22

    This is the fourteenth part of the VHR series. The project address is https://github.com/lend/vhr The online chat function is for the convenience of HR quick communication. Due to the limited number of HR people, the high concurrency problem is not considered here, and the thinking of small partners must be combined with the context. OK, […]