pomelo 調試環境 chrome
環境: win7, chrome 26.0, nodejs v0.10.22, pomelo 0.7.6
測試代碼: https://github.com/NetEase/chatofpomelo-websocket
webstorm 調試 http://nodejs.netease.com/topic/515251b97f53b3d3330025c7
因爲原來沒有用過chrome調試過js,想用用,所以就試着配置了pomelo的chrome調試環境
安裝node-inspector
調試前啓動node-inspector來監聽Nodejs的debug調試端口
設置pomelo的調試端口game-server/config/server.json (可以給gate, chat, connector)
然後啓動 pomelo 的 game-server, web-server
在瀏覽器輸入 http://127.0.0.1:8080/debug?port=32123 (32123是上面設置的調試端口)
在gateHandler.js 的 handler.queryEntry = function(msg, session, next) { 打上斷點, 執行登錄
可以看到成功斷下
Note:
目前比較麻煩的時候,要調試gate -- debug 32123, chat -- debug 32124, 瀏覽器就要開2個標籤,不知道有沒有能在一個標籤裏面調試的方法?