`
lavafree
  • 浏览: 534078 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

openfire+jwchat+nginx搭建XMPP的webim

    博客分类:
  • Java
阅读更多

openfire+jwchat+nginx搭建XMPP的webim

 

Openfire是一个强大的即时消息(IM)和聊天服务器,它实现了XMPP协议,下载

http://www.igniterealtime.org/projects/openfire/

jwchat是XMPP的一个客户端实现,下载

http://blog.jwchat.org/jwchat/

nginx作为jwchat的运行容器,实现http-bind,下载

http://nginx.org/

 

下载后先安装Openfire,安装比较简单,

window下解压后,进入bin下面,运行openfire.exe,

启动服务,浏览器输入http://localhost:8080,然后按提示安装即可

 

nginx安装,window下nginx解压即可用。

 

jwchat解压,使用中文版,所以把jwchat目录下面的.zh_CN为后缀的都去掉。

把整个目录拷贝到nginx的html下面

 

配置jwchat的config.js文件

var SITENAME = "localhost"; #服务器的ip,非本机改为特定ip或者服务

 

var BACKENDS = 
[
		
		{
			name:"Native Binding",
			description:"Ejabberd's native HTTP Binding backend",
			httpbase:"/http-bind/",
			type:"binding",
			servers_allowed:[SITENAME]
		},
		/*这部分注释掉
		{
			name:"Native Polling",
			description:"Ejabberd's native HTTP Polling backend",
			httpbase:"/http-poll/",
			type:"polling",
			servers_allowed:[SITENAME]
		},
		{
            name:"Open Relay",
            description:"HTTP Binding backend that allows connecting to any jabber server",
            httpbase:"/jhb/",
            type:"binding",
            default_server: SITENAME
        },
		{
			name:"Restricted Relay",
			description:"This one let's you choose from a limited list of allowed servers",
			httpbase:"/JHB/",
			type:"binding",
			servers_allowed:[SITENAME,'jabber.org','jwchat.org']
		}
		*/
];

 

配置nginx

在nginx的conf文件下打开nginx.conf,添加http-bind的代理设置

#在

#gzip  on;

#下增加

upstream openfire {
        server 127.0.0.1:7070;
    }

 在

location / {

        root   html;

        index  index.html index.htm;

    }

之上增加

location /http-bind {
        proxy_pass http://bk.openfire;
        proxy_buffering off;
        proxy_redirect off;
        proxy_read_timeout 120;
        proxy_connect_timeout 120;
	}
 配置完成,启动nginx,然后浏览器访问

http://localhost/jwchat使用

 


 

  • 大小: 153.8 KB
2
3
分享到:
评论
4 楼 pengyufight 2016-08-11  
我现在已经把jwchat项目的源码导入MyEclipse10中了,可以使用,tomcat7.0,jdk1.7,无需这么多的配置,所有的东西已经在源码中配置好了,感谢楼主,也欢迎大家下载我的源码,一起交流,共同进步
http://download.csdn.net/detail/pengyufight/9600755
3 楼 pengyufight 2016-08-11  
感谢楼主!
2 楼 bluky999 2014-01-07  
LZ 不是用Openfire 么? 怎么跑出来 Ejabberd ?   
1 楼 bluerose 2013-07-23  
按照你说的 试了不行。你那有配置好的包么。能发一下给我吗 先谢了。我搞了很久了
邮箱:282187146@qq.com

相关推荐

Global site tag (gtag.js) - Google Analytics