浏览器间的实时通讯框架 Orbited

码农软件 · 软件分类 · 其他开发相关 · 2019-10-30 22:29:44

软件介绍

Orbited 提供一个纯 JavaScript 和 HTML 的浏览器 Socket 通讯包,你可以把它看成是web的路由器和防火墙,允许你的web应用和后端的系统进行通讯,在这基础上你可以实现任何的网络通信协议。

要使用 Oribited 当然还需要一个服务器端,这是用 Python 开发的一个服务程序,用来处理来自浏览器之间的通讯请求。点击这里查看在 Windows 下的安装方法。

这里有一个使用 Oribited 搭建的Web聊天室的在线演示

体系结构图:

一段示例代码:

<script type="text/JavaScript">
Orbited.settings.port = 9000;
amqp_broker_port = 7000;

amqp_conn = amqp.Connection({host: 'localhost',
port: amqp_broker_port,
send_hook: function(msg) { // for debugging
append_msg('SENT', msg);
},
recive_hook: function(data) { // for debugging
append_msg('RECV', data);
}
});
amqp_conn.start();

// You should have your server generate a UUID since browser methods
// are unreliable at best
session = amqp_conn.create_session('not_a_great_id' + (new Date().getTime() + Math.random()));

var fedoraproject = "org.fedoraproject-" + session.name;
session.Queue('declare', {queue:fedoraproject, exclusive:true});
session.Exchange('bind', {exchange: "amq.topic",
queue: fedoraproject,
binding_key: "org.fedoraproject.#"});

// Bind each queue to the control queue so we know when to stop
session.Exchange('bind', {exchange:"amq.topic",
queue: fedoraproject,
binding_key:"control"});
</script>

本文地址:https://codercto.com/soft/d/17926.html

Bandit Algorithms for Website Optimization

Bandit Algorithms for Website Optimization

John Myles White / O'Reilly Media / 2013-1-3 / USD 19.99

This book shows you how to run experiments on your website using A/B testing - and then takes you a huge step further by introducing you to bandit algorithms for website optimization. Author John Myle......一起来看看 《Bandit Algorithms for Website Optimization》 这本书的介绍吧!

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具