Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a "real server" for websockets in Haskell?

The documentation for Network.WebSockets.runServer says:

Note that this is merely provided for quick-and-dirty standalone applications, for real applications, you should use a real server.

Is this "real server" a reference to something that I'm supposed to know about (if I were more familiar with the Haskell ecosystem), or something that doesn't exist yet?

like image 897
Chris Martin Avatar asked Nov 04 '15 04:11

Chris Martin


People also ask

Does WebSocket need a server?

By definition websockets like normal sockets are client-server so yes, you need a server. However there is an alternative to waiting for Apache plugins. I am using a hosted server http://www.achex.ca. Its free and you have tutorials in javascript on how to use the server.

What is WebSockets server?

A WebSocket server is nothing more than an application listening on any port of a TCP server that follows a specific protocol. The task of creating a custom server tends to scare people; however, it can be straightforward to implement a simple WebSocket server on your platform of choice.

Are WebSockets real-time?

WebSockets are used for real-time communication between the browser and a server. These communications are bi-directional. Therefore it fits low latency applications such as chat, real-time multiplayer gaming, in-app notifications.


1 Answers

The actual server can be any TCP application. All you need is support of Berkeley socket from your programming language. This is a nice tutorial from Mozilla on how to write a websocket server.

The real production quality server in Haskell ecosystem is warp. You can use wai-websockets to target it to Warp. In fact wai-websockets uses the package websockets internally.

like image 149
Sibi Avatar answered Oct 17 '22 20:10

Sibi