简体   繁体   English

通过Internet在两台计算机之间发送命令

[英]Send commands between two computers over the internet

I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. 我希望在家中使用连接到互联网的任何计算机来控制我的计算机(以及连接到计算机的USB设备)。 The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. 家中的计算机必须安装一个程序,该程序接收来自连接到互联网的任何其他计算机的命令。 I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. 我认为如果我使用Web界面这样做是最好的,因为没有必要在该计算机上安装软件。 For obvious reasons it would require log in details. 出于显而易见的原因,它需要登录详细信息。

Extra details : The main part of the project is actually a device that I will develop that connects to the computer's usb port. 额外的细节 :项目的主要部分实际上是我将开发的连接到计算机的USB端口的设备。 Sorry if it was a bit vague in my original question. 对不起,如果我原来的问题有点模糊。 This device will perform simple functions such as turning lights on etc. At first I will just attempt to switch the lights remotely using the internet. 该设备将执行简单的功能,如打开灯等。首先,我将尝试使用互联网远程切换灯。 Later on I will add commands that can control certain aspects of the computer such as the music player. 稍后我将添加可以控制计算机某些方面的命令,例如音乐播放器。 I think doing a full remote desktop connection to control my device is therefore not quite necessary. 因此,我认为进行完整的远程桌面连接来控制我的设备并不是必需的。 Does anybody know of any open source projects that can perform these functions? 有没有人知道任何可以执行这些功能的开源项目?

So basically the problem is sending encrypted commands from a web interface to my computer at home. 所以基本上问题是将加密的命令从Web界面发送到我家的计算机。 What would be the best method to achieve this and what programming languages should I use? 实现这一目标的最佳方法是什么?我应该使用哪种编程语言? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP. 我非常了解Java,Python和C,但对Web应用程序(如Javascript和PHP)的经验很少。

I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. 我查看了网络聊天示例,因为它与我希望实现的类似,但文本可以替换为命令。 Is this a viable solution or are there better alternatives? 这是一个可行的解决方案还是有更好的选择?

Thank you 谢谢

You can write a WEB APPLICATION. 您可以编写WEB应用程序。 The encryption part is solved by simple HTTPS usage. 加密部分通过简单的HTTPS使用来解决。 On the server side (your home computer with USB devices attached to it) you should use Python (since you're quite experienced with it) and a Python Web Framework you want (IE Django). 在服务器端(连接有USB设备的家用计算机),您应该使用Python (因为您对它非常有经验)和您想要的Python Web Framework(IE Django)。

While it is an interesting programming question, perhaps you should ask it on ServerFault instead? 虽然这是一个有趣的编程问题,或许你应该在ServerFault上问它? There you can probably get a lot of nice input on web-based administration / control tools. 在那里,您可以在基于Web的管理/控制工具上获得很多很好的输入。

Unless this is a "for fun" project for you, there are about a jillion things out there that already do this. 除非这对你来说是一个“有趣”的项目,否则大约有很多东西可以做到这一点。 And if you want to control a computer from a web browser, be prepared to require installing some kind of custom plugin - since browsers can't touch arbitrary files on the local filesystem, execute local applications, or do other things that are flagrant security risks. 如果您想从Web浏览器控制计算机,请准备好安装某种自定义插件 - 因为浏览器无法触及本地文件系统上的任意文件,执行本地应用程序或执行其他具有明显安全风险的事情。

I've been using VNC for over a decade - free and easy. 我已经使用VNC超过十年了 - 免费且简单。

http://en.wikipedia.org/wiki/Virtual_Network_Computing http://en.wikipedia.org/wiki/Virtual_Network_Computing

Well, I think that java can work well, in fact you have to deal with system calls to manage usb devices and things like that (and as far as I know, PHP is not the best language to do this). 好吧,我认为java可以很好地工作,事实上你必须处理系统调用来管理usb设备和类似的东西(据我所知,PHP不是最好的语言)。 Also shouldn't be so hard to create a basic server/client program, just use good encryption mechanism to not show commands around web. 也不应该这么难创建一个基本的服务器/客户端程序,只需使用良好的加密机制来不显示web周围的命令。

I you are looking for solution you could use from any computer anywhere in the worls without the need to install any software on client pc, try logmein.com (http://secure.logmein.com). 我正在寻找您可以在任何地方的任何计算机上使用的解决方案,而无需在客户端PC上安装任何软件,请尝试logmein.com(http://secure.logmein.com)。

It is free, reliable, works in any modern browser, you don't have to remmeber IPs and hope they won't change, ... 它是免费的,可靠的,适用于任何现代浏览器,您不必记住IP并希望它们不会改变,...

Or if this is a "for fun project" why not write a php script, open port 80 in your router so you can access you script from outside, possibly dynamically link some domain to your IP (http://www.dyndns.com/). 或者,如果这是一个“有趣的项目”,为什么不写一个PHP脚本,在您的路由器中打开端口80,这样您就可以从外部访问您的脚本,可能动态地将某个域链接到您的IP(http://www.dyndns.com) /)。 In the script you would just login and then for example type the orders in textfield in some form in your script. 在脚本中,您只需登录,然后在脚本中以某种形式在文本字段中键入订单。 Lets just say you want to do some command prompt stuf, so you will basically remotely construst a *.bat file for example. 让我们说你想做一些命令提示符stuf,所以你基本上会远程控制一个* .bat文件。 Then the script stores this a fromtheinternets.bat to a folder on your desktop that is being constantly monitored for changes. 然后,脚本会将此文件从theinternets.bat存储到桌面上的文件夹中,该文件夹会不断监视更改。 And when such a change is found you just activate the bat file. 当发现这样的更改时,您只需激活bat文件即可。 Insecure? 不安全? Yes (It could be made secureER) Fun to write? 是的(它可以变得安全)写得好玩吗? Definitely 无疑

PS: I am new here, hope it's not "illegal" to post link to actual services, instead of wiki lists. PS:我是新来的,希望发布链接到实际服务而不是维基列表并非“非法”。 This is by no means and advertisement, I am just a happy user. 这绝不是广告,我只是一个快乐的用户。 :) :)

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

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