-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
egg 使用心得收集 #254
Comments
侧栏增加「资源」resources |
@popomore 在此收集,然后合适的文章我们再收录到官网文档。 |
学习egg的时候发现它的调试挺蛋疼,自己研究了一下写了个教程,分享一下: |
@garygchai 有个内网链接 |
@garygchai 你的文章应该修改一下
startMasterSocketServer(cb) {
// Create the outside facing server listening on our port.
require('net').createServer({ pauseOnConnect: true }, connection => {
// We received a connection and need to pass it to the appropriate
// worker. Get the worker for this connection's source IP and pass
// it the connection.
const worker = this.stickyWorker(connection.remoteAddress);
worker.send('sticky-session:connection', connection);
}).listen(this.options.port, cb);
} |
这个是 @ngot 新加的, 为 socket.io 做的铺垫 |
注册,登录, 权限管理, 等需要一些demo |
使用VSCode调试时发现一直报超时错误,看了一下调试控制台发现是端口有问题
将Launch Egg任务的端口号改成9229后可以正常调试,不知道是不是我的环境问题
VSCode:1.15.1
|
@xinayida 这个问题折腾了一天多,前后看了不少的源代码,走了些弯路,调试终于是比较爽了,node8之后调试,agent默认调试端口是5856, 除了你提到的9229端口修改之外,还要改下 agent协议也改成inspector 同时如果是--inspector-brk 调试, vscode attact 默认超时时间是10s钟,很容易过,所以后面框架启动代码是很难断得到,所以还要把timeout时间延长到比你启动框架时间长 分享下我的调试文件,现在完美调试,希望调试egg的同学不在困扰了,希望官方文档也更新下,新手容易迷失 ps: vscode 1.15.1
|
调试的优化看 #1376 |
鉴于 egg 文档基本上完成第一稿了,现向各位征集 egg 使用和实践心得之类的文章。
请在本 issue 回复对应的 blog 文章地址。
参考格式:
The text was updated successfully, but these errors were encountered: