在使用phpsocket.io时需要https支持,在配置的时候踩了不少坑,这里做一下笔记。

如果你的ssl比较多,当然可以用独立域名来配置phpsocket.io 那就比较简单。只需要用nginx代理ssl就可以了,配置如下

server {
listen 443;

# host name to respond to
server_name ws.example.com;

# your SSL configuration
ssl on;
ssl_certificate /etc/ssl/localcerts/ws.example.com.bundle.crt;
ssl_certificate_key /etc/ssl/localcerts/ws.example.com.key;

location / {
# switch off logging
access_log off;

# redirect all HTTP traffic to localhost:8080
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# WebSocket support (nginx 1.4)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
}
}

Read More →

服务器信息传输

// send to current request socket client
socket.emit(‘message’, “this is a test”);

// sending to all clients except sender
socket.broadcast.emit(‘message’, “this is a test”);

// sending to all clients in ‘game’ room(channel) except sender
socket.broadcast.to(‘game’).emit(‘message’, ‘nice game’);

// sending to all clients, include sender
io.sockets.emit(‘message’, “this is a test”);

// sending to all clients in ‘game’ room(channel), include sender
io.sockets.in(‘game’).emit(‘message’, ‘cool game’);

// sending to individual socketid
io.sockets.socket(socketid).emit(‘message’, ‘for your eyes only’);
上述集中方式为socket.io常用的数据传输方式,

io.sockets.on(‘connection’, function (socket) {

});

回调函数的socket参数为一个 client 与服务器的连接标示,不同的 client 会有不同的连接标示。

Read More →

1,从版本控制系统创建项目:

CVS -> Checkout from Version Control
2, 关联DOC文档:

右键External Librariese -> Configure PHP include paths
3, 去掉波浪线:

settings -> Editor -> Colors & Fonts -> General -> TYPO->Effects
4, 显示行号:

settings -> Editor->Appearance->Show line numbers
5,远程或本地同步文件:

Tools -> Deploments -> Configuration
6, 去掉右上角浏览器图标:

settings -> tools -> WebBrowsers
7, 添加VIM插件:

settings->editor ->plugins->browse repositories ->搜索VIM
8,启动的时候不打开工程文件

Settings->General去掉Reopen last project on startup.
9, 取消自动保存

appearance -> system settings -> save file的两个选项 去掉
10, 将编辑的文件加星号标识:

settings -> editor -> editor tabs -> 勾选 mark modifed tabs…

11, 添加扩展名高亮显示:

settings -> editor -> file types

12, 修改字体大小

settings -> editor -> colors & fonts -> Font

Read More →

一:JS 重载页面,本地刷新,返回上一页
复制代码 代码如下:

<a href=”javascript:history.go(-1)”>返回上一页</a>
<a href=”javascript:location.reload()”>重载页面,本地刷新</a>
<a href=”javascript:history.go(-1);location.reload()”>返回上一页重载页面,本地刷新</a>

返回前二页并刷新的JS代码应该怎样写。
复制代码 代码如下:

history.go(-2);
location.reload();

二:js 方法
复制代码 代码如下:

<a href=”#” onclick=”self.location=document.referrer;”>返回</a>

Read More →

1.下载svn 总共两个问题 TortoiseSVN-1.9.4.27285-x64-svn-1.9.4.msi LanguagePack_1.9.4.27285-x64-zh_CN.msi

2.如果直接安装msi 会提示提示2502、2503的错误代码这里我们用 命令提示符(管理员)来安装,首先切换到文件目录下

msiexec /package TortoiseSVN-1.9.4.27285-x64-svn-1.9.4.msi

msiexec /package LanguagePack_1.9.4.27285-x64-zh_CN.msi

这样就可以了