一直想做一个即时聊天的应用,前几天看到了socket.io,感觉还不错,自己略加修改,感觉挺不错的。官网上给的例子很简单,下面改进了一点,实现了历史消息的推送。
demo地址:chat.androiddevelop.cn
其中服务器端代码:
var app = require('express')();
var http = require('http').Server(app);
...
分类:
Web程序 时间:
2014-08-23 01:10:09
阅读次数:
278
A trusted computer system that offers Linux® compatibility and supports contemporary hardware speeds. It is designed to require no porting of common a...
分类:
数据库 时间:
2014-08-22 23:50:19
阅读次数:
441
在 angular 中我们经常会使用多个 controller 和 指令他们拥有各自的 $scope , 这就产生了跨$scope调用的问题。有几种常见的方法来可以使用.方法一 : 指令 require ...
分类:
其他好文 时间:
2014-08-22 23:44:49
阅读次数:
266
情况描述:在Watir-Webdriver环境下运行脚本报错(红色标记部分):C:\>irbirb(main):001:0> require 'watir-webdriver'=> trueirb(main):002:0>Watir::Browser.new :ieSelenium::WebDriv...
分类:
Web程序 时间:
2014-08-22 17:36:39
阅读次数:
309
require 'open-uri'require 'json'require 'net/http'class CoupleController [:raw_data_put] def raw_date_get #如果有GET请求参数直接写在URI地址中 begin uri...
分类:
其他好文 时间:
2014-08-22 12:41:06
阅读次数:
358
Linux (RedHat, CentOS)上升级R语言:sudo yum install RWindows上升级R语言:install.packages("installr"); require(installr) #load / install+load installrupdateR()REF...
分类:
其他好文 时间:
2014-08-22 12:23:56
阅读次数:
232
--lua代码localhttp=require"socket.http"localltn12=require("ltn12")request_body=‘u=1¶meter={"m":"S"}‘localresult=http.request{url="http://127.0.0.1/2.php",sink=ltn12.sink.file(io.stdout),method="POST",headers={["Content-Type"]="application/x-www-form..
分类:
其他好文 时间:
2014-08-21 19:41:35
阅读次数:
489
安装socket.ionpminstallsocket.io或者在package.json文件中添加socket.io的依赖包,然后npminstall安装所需模块。在Expresshttp服务器中使用socket.io在bin/www文件中添加:vario=require(‘socket.io‘);
varsocket=io.listen(server);
socket.on(‘connection‘,function(client..
分类:
Web程序 时间:
2014-08-21 19:35:55
阅读次数:
638
http模块提供了两个常用的功能, 创建一个http server和做http请求.创建一个http servervar http = require('http');var server = http.createServer();server.on('request', function(req...
分类:
Web程序 时间:
2014-08-21 14:39:34
阅读次数:
154
起因是我在画y轴的标题时,不能显示上标,米<sup>3</sup> ?会显示 ? 米3 ! 问过林峰,他说这是基于canvas,不是基于svg或html,所以不能处理这个。然后就想用zrender画出这个字。我只需要解决上标的问题就够了!...
分类:
其他好文 时间:
2014-08-21 09:55:04
阅读次数:
216