简体   繁体   English

从Javascript / Mac OS X小部件/ Dashcode连接到服务器服务

[英]Connecting to a server service from Javascript/Mac OS X widget/Dashcode

My question is fairly short: I'm trying to open a simple TCP connection (lets say on port 110 = POP3) sending an command and getting the response with the Javascript API inside Mac OS X widgets using Dashcode. 我的问题很简短:我正在尝试打开一个简单的TCP连接 (假设在端口110 = POP3上), 该命令发送命令并使用Dashcode在Mac OS X小部件中使用Javascript API 获得响应 But the problem is that I have no ideas to get this stuff working. 但是问题是我不知道如何使这些东西正常工作。

So have you got any ideas? 那么您有什么想法吗? I've tried on XHTTPRequest but as the name says this stuff works with HTTP protocol but I don't need this HTTP stuff. 我已经尝试过XHTTPRequest,但是顾名思义,这些东西适用于HTTP协议,但我不需要这个HTTP东西。

I found a workaround: using a ruby script makes it easy to fetch those information I need. 我找到了一种解决方法:使用ruby脚本可以轻松获取所需的信息。 And ruby seems to be bundled with Mac OS X. The ruby script can be added in Dashcode and called via widget.system("/usr/bin/ruby yourscript.rb", null) . 红宝石似乎与Mac OS X捆绑在一起。红宝石脚本可以在Dashcode中添加,并可以通过widget.system("/usr/bin/ruby yourscript.rb", null)

Works for me! 为我工作!

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

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