IPython Documentation

Table Of Contents

Previous topic

Module: html.base.handlers

Next topic

Module: html.files.handlers

This Page


This documentation is for a development version of IPython. There may be significant differences from the latest stable release.

Module: html.base.zmqhandlers

Tornado handlers for WebSocket <-> ZMQ sockets.

2 Classes

class IPython.html.base.zmqhandlers.ZMQStreamHandler(application, request, **kwargs)

Bases: tornado.websocket.WebSocketHandler


Allow draft 76, until browsers such as Safari update to RFC 6455.

This has been disabled by default in tornado in release 2.2.0, and support will be removed in later versions.


Check Origin == Host or Access-Control-Allow-Origin.

Tornado >= 4 calls this method automatically, raising 403 if it returns False. We call it explicitly in open on Tornado < 4.

meaningless for websockets

class IPython.html.base.zmqhandlers.AuthenticatedZMQStreamHandler(application, request, **kwargs)

Bases: IPython.html.base.zmqhandlers.ZMQStreamHandler, IPython.html.base.handlers.IPythonHandler


The interval for websocket keep-alive pings.

Set ws_ping_interval = 0 to disable pings.


If no ping is received in this many milliseconds, close the websocket connection (VPNs, etc. can fail to cleanly close ws connections). Default is max of 3 pings or 30 seconds.


send a ping to keep the websocket alive


Undo the set_default_headers in IPythonHandler

which doesn’t make sense for websockets