简体   繁体   中英

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. 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.

I found a workaround: using a ruby script makes it easy to fetch those information I need. 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) .

Works for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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