- 准备
- openfire服务器(http://www.igniterealtime.org)——IM Server
- ngnix服务器(http://nginx.org)——代理和HTTP Server
- strophe库(http://strophe.im/)——JS客户端
- 安装和配置openfire
openfire的安装见本人博客,安装时配置domain为172.17.125.161(注意除非PC配置了域名,不然最好domain配置为IP,方便客户端访问),后登录管理控制台,服务器》服务器设置》HTTP绑定,默认启用7070端口作为HTTP绑定端口。
- 安装和配置nginx
我安装的是windows版,直接解压到本地目录,打开conf目录下nginx.conf,修改server节点为如下:
server {
listen 80;
server_name 172.17.125.161;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /http-bind {
proxy_pass http://172.17.125.161:7070/http-bind/;
proxy_red