简体   繁体   English

我可以使用Google App Engine托管Java IRC Bot吗?

[英]Could I use Google App Engine to host a Java IRC Bot?

I have an IRC bot written entirely in Java that I've been hosting on my home computer, but my iffy internet connection has been disconnecting it a lot. 我有一个完全用Java编写的IRC机器人,我一直在家用计算机上托管它,但是我那不稳定的Internet连接使它断开了很多连接。 I've been wondering if I could use the Google Apps Engine to host the bot with a constant connection? 我一直想知道我是否可以使用Google Apps Engine来以恒定连接托管该机器人? If so, what kind of changes am I going to have to make? 如果是这样,我将必须进行哪些更改?

Thanks for the help 谢谢您的帮助

No, you cannot do that. 不,你不能那样做。 Google App Engine does not allow arbitrary outgoing Socket connections (probably because they do not want people using their platform as a proxy server). Google App Engine不允许任意的传出Socket连接(可能是因为他们不希望人们将其平台用作代理服务器)。 The closest thing they offer is the URL Fetch API for accessing external content over the network/Internet. 他们提供的最接近的东西是URL Fetch API,用于通过网络/ Internet访问外部内容。

Using that, you might be able to come up with something that drives an existing web-based IRC client using an App Engine app. 使用它,您可能可以提出一些通过App Engine应用程序来驱动现有的基于Web的IRC客户端的方法。 Though I'm not sure what benefit that would have over just using a web-based IRC client directly. 尽管我不确定仅直接使用基于Web的IRC客户端会有什么好处。

Also you cannot have a "constant connection" to (or from) an App Engine app. 另外,您无法与App Engine应用(或从App Engine应用)建立“持续连接”。 The platform will automatically time-out/close any request that has not completed processing within about 30 seconds or so. 平台将在大约30秒左右的时间内自动超时/关闭尚未完成处理的任何请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM