Skip to content
This repository was archived by the owner on Dec 20, 2017. It is now read-only.

允许远程访问调试云代码#92

Closed
marrowleaves wants to merge 3 commits intoleancloud:masterfrom
marrowleaves:master
Closed

允许远程访问调试云代码#92
marrowleaves wants to merge 3 commits intoleancloud:masterfrom
marrowleaves:master

Conversation

@marrowleaves
Copy link

No description provided.

@sdjcw
Copy link
Contributor

sdjcw commented Sep 17, 2015

非常感谢。
这个功能是不是应该配套提供一个可以选择调用本地还是服务器的选项会更加方便呢?

@marrowleaves
Copy link
Author

这个PR只是不希望调试服务器域名hardcode为localhost,这样可以同时允许本地调试和远程访问,可以多人同时调测

@aisk
Copy link
Contributor

aisk commented Sep 23, 2015

@marrowleaves 默认打开的话,对于在非安全环境的人可能会有危险,建议使用开关的方式来实现,比如 avoscloud -H xxx -p 4000 的选项来指定要监听的 host 和端口。

@marrowleaves
Copy link
Author

@aisk 这个改动是希望云函数调用时使用的host和打开云函数调试页面的host一致。考虑安全的话目前testUtilServer.js在调用app.listen时没有传入hostname参数,使用的是Node.js默认的0.0.0.0。这个修改并没有造成额外安全方面的问题。

@aisk
Copy link
Contributor

aisk commented Oct 13, 2015

@marrowleaves 0.0.0.0 这个地址就会有风险,因为这个时候服务监听的就是外网。如果当前机器是公网 IP 的话任何人都能访问到开发中的服务。局域网的话也有一定风险。因此开发环境没有特殊原因一定不能监听 0.0.0.0。

@marrowleaves
Copy link
Author

你們本來的testUtilServer.js就是監聽0.0.0.0的,新的commit加入了監聽主機名的命令行選項

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants