标签: telnet

在Java中启动VLC并通过rc接口连接到它

我已经看过这个帖子,但是我还有一个问题:在java中启动vlc播放器 看起来VLC的Java绑定不再处于活动开发状态,并且无论如何都不支持命令行上的所有内容.

鉴于以下代码,我无法从Mac OS 10.5.8(Java 1.6)上的Java应用程序启动VLC,然后通过终端或其他Java应用程序通过rc接口连接到它.

public class Main {

public static void main(String[] args) {
    String s = null;


    try {
        //Process p = Runtime.getRuntime().exec("/Applications/VLC.app/Contents/MacOS/VLC -I telnet --telnet-host=localhost:4442 -I rc --rc-host=localhost:4444");
        //Process p = Runtime.getRuntime().exec("/Applications/VLC.app/Contents/MacOS/VLC -I rc --rc-host=localhost:4444");

        //ProcessBuilder pb = new ProcessBuilder("/Applications/VLC.app/Contents/MacOS/VLC","-I rc","--rc-host=localhost:4444");
        ProcessBuilder pb = new ProcessBuilder("/Applications/VLC.app/Contents/MacOS/VLC","-IRC","--rc-host=localhost:4444");
        Process p = pb.start();

        StreamGobbler errorGobbler = new StreamGobbler(p.getErrorStream(), false);
        StreamGobbler inputGobbler = new StreamGobbler(p.getInputStream(), false);
        errorGobbler.start();
        inputGobbler.start();

        System.out.println("Waiting: \n"+p.waitFor());       
        System.out.println("All done here");
        //p.destroy();
        //System.exit(0);

  } catch (IOException ioe) …
Run Code Online (Sandbox Code Playgroud)

java controls telnet vlc

5
推荐指数
2
解决办法
7355
查看次数

与Perl的Net :: Telnet连接时,如何修复"未知终端类型"?

我在使用Perl的Net :: Telnet模块连接到SUSE linux机器时出了问题.代码如下所示:

my $t = new Net::Telnet (Timeout => 20);
$t->open($server);
$t->input_log("telnet.log");
$t->login($user, $pass);
my @lines=$t->cmd($command);
print @lines;
Run Code Online (Sandbox Code Playgroud)

日志文件如下所示:欢迎使用SUSE Linux Enterprise Server 10 SP1(x86_64) - 内核2.6.16.46-0.12-default(5).

vm-sles10u5 login: <myuser>
Password: 
Last login: Thu Feb 25 10:41:07 EST 2010 from <mymachine> on pts/5
tset: unknown terminal type network
Terminal type? 
Run Code Online (Sandbox Code Playgroud)

有什么建议?

perl telnet

5
推荐指数
1
解决办法
9331
查看次数

twisted manhole:如何在应用程序中访问服务器?

我需要在运行时连接到我扭曲的应用程序,并且我正在尝试使用twisted.manhole为我工作.我在Mac OSX 10.6上使用默认安装的扭曲8.2.

使用twistd示例服务器工作.在启动时有关于md5,sha和twisted.protocols.telnet的DeprecationWarnings,但是沙井服务器实际上做了它应该做的事情,我可以访问我的应用程序的内部:

host:client user$ telnet localhost 4040
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

twisted.manhole.telnet.ShellFactory
Twisted 8.2.0
username: admin
password: *****
>>> dir()
['_', '__builtins__', 'factory', 'service']
>>> factory
<twisted.manhole.telnet.ShellFactory instance at 0x101256440>
>>> service
<twisted.application.internet.TCPServer instance at 0x10124ff38>
>>> service.parent
<twisted.application.service.MultiService instance at 0x1014b0cf8>
>>> 
Run Code Online (Sandbox Code Playgroud)

现在我尝试将其集成到我的应用程序中:

# test_manhole.tac

from twisted.application.internet import TCPServer
from twisted.application.service  import Application, IServiceCollection
from twisted.manhole.telnet       import ShellFactory

shell_factory = ShellFactory()
shell_factory.username = 'admin'
shell_factory.password …
Run Code Online (Sandbox Code Playgroud)

python twisted telnet

5
推荐指数
1
解决办法
3518
查看次数

在ruby中发送和接收TCP数据

我有一个TCP服务器运行,接受命令"GETHELLO"并返回"HELLO".我在linux shell中使用Telnet测试它:

:~$ telnet 192.168.1.10 3000
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
GETHELLO
HELLO
Run Code Online (Sandbox Code Playgroud)

如何使用TCPSocket在ruby中执行此操作?(发送"GETHELLO"并读取服务器返回的数据"HELLO")

谢谢!

ruby sockets tcp telnet

5
推荐指数
1
解决办法
1万
查看次数

ArgumentError:已请求SMTP-AUTH但缺少用户名+ ActionMailer

每当我尝试使用actionmailer传递邮件时,我无法使用actionmailer发送邮件它报告错误

ArgumentError:SMTP-AUTH已请求但缺少用户名

这是奇怪的,因为我能够通过Telnet发送邮件但不使用ActionMailer

附加Telnet屏幕截图

这是我的SMTP设置

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
    :address => '216.224.183.100',
    :port                 => 25,
    :domain               => '[domain_name]',
    :username             => "[username]",
    :password             => "[password]",
    :authentication       => 'plain',
   :enable_starttls_auto => true
 }
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉通过邮件没有被发送

在此输入图像描述

smtp ruby-on-rails telnet actionmailer mailer

5
推荐指数
1
解决办法
7156
查看次数

使用Python的telnetlib进行非常慢的交互

我正在编写一个Python脚本,该脚本通过Telnet连接到Linux终端,运行许多命令并解析输出,然后根据输出运行更多命令,等等。

This was quite easy to set up using telnetlib. I'm using write(cmd + '\n') to send the command and then read_until(prompt) to read the output. The problem I'm having is that this setup seems to be very slow. Every command takes maybe around 100-200 ms to run. This makes the total run time around half a minute, which I find to be too long.

If I connect to the terminal using a normal Telnet client the commands I'm …

python telnet

5
推荐指数
1
解决办法
4802
查看次数

无法从命令行使用telnet获取http响应

我正在使用Windows 7(x64).我想从命令行发送一个http请求并获得响应.我用的是Telnet.我输入命令行:telnet www.google.com 80. 在此输入图像描述 按"Enter"后,屏幕变为黑色(一切都从cmd屏幕消失). 在此输入图像描述

几分钟后,它显示标准命令提示符而不输出任何内容. 在此输入图像描述

当我在命令行中启动telnet(telnet不带参数键入)并键入时o www.google.com 80,它会输出Connecting to www.google.com.几分钟后,它说press any key.按任意键后输出The connection was lost

我的问题是:我怎样才能真正获得http响应?怎么了?

command-line cmd telnet windows-7

5
推荐指数
1
解决办法
2万
查看次数

使用Telnet的Node.js客户端和服务器游戏

我正在尝试使用Node.js创建一个基本游戏(只有文本),它是'net'库.
我打了一堵墙.我似乎无法弄清楚如何提示用户输入一些信息,并等待用户输入所述信息.

这是我到目前为止的代码.这是相当基本的,当你运行客户端时会打印出2行,然后挂起.就在那时,我希望用户能够输入信息.我不确定这里的一些事情:
1.如何让用户输入?(更具体地说,是客户端还是服务器端)
2.如果按下enter键,如何将该数据发送到服务器?

我已经阅读了一些关于Telnet的文档,它引出了我的最后一个问题:Node中的Telnet模块是否真的是正确的,或者是否有更好的客户端/服务器创建和通信替代方案?



客户代码:

var connect = require('net');

var client = connect.connect('80', 'localhost');
console.log('Connection Success!\n\n');
client.on('data', function(data) {
  // Log the response from the HTTP server.
  console.log('' + data);
}).on('connect', function() {
  // Manually write an HTTP request.
  //I'm assuming I could send data at this point here, on connect?
}).on('end', function() {
  console.log('Disconnected');
});
Run Code Online (Sandbox Code Playgroud)



服务器代码:

var net = require('net');

var sockets = [];

function cleanInput(data) {
    return data.toString().replace(/(\r\n|\n|\r)/gm,"");
}

function receiveData(socket, data) {
    var cleanData = …
Run Code Online (Sandbox Code Playgroud)

javascript client-server telnet node.js

5
推荐指数
1
解决办法
6324
查看次数

无法连接到gmail的smtp服务器.为什么?

我正在尝试使用连接到gt的smtp服务器

telnet gmail.smtp.com 587
Run Code Online (Sandbox Code Playgroud)

当我在家里尝试时,它会被连接起来.但是,当我从办公室尝试时,它显示错误.可能是什么问题?

这是我连接到smtp.gmail.com的错误:

Could not open connection to the host, on port 587: Connect Failed
Run Code Online (Sandbox Code Playgroud)

gmail smtp telnet

5
推荐指数
1
解决办法
1万
查看次数

如何使用Python库(如Paramiko)通过Telnet和SSH进行链式连接

与此处提出的问题类似: 使用python的SSH和telnet到localhost

我正在尝试找到以下问题的解决方案:

从服务器A(具有Jumhost B的完整权限)(无sudo),我想使用Python连接到多个网络设备(一个接一个就足够了,不必同时使用)。仅使用SSH不会有什么问题,但是许多设备仅使用Telnet(我知道这是不安全的,但这并不是我决定这样做的决定)。

经过研究,我遇到了用于SSH链连接的多种解决方案,例如Paramiko,Netmiko,Pxssh等。但是我找不到通过Telnet实现最后一步的正确方法。目前,我有以下代码:

class SSHTool():
def __init__(self, host, user, auth,
             via=None, via_user=None, via_auth=None):
    if via:
        t0 = ssh.Transport(via)
        t0.start_client()
        t0.auth_password(via_user, via_auth)
        # setup forwarding from 127.0.0.1:<free_random_port> to |host|
        channel = t0.open_channel('direct-tcpip', host, ('127.0.0.1', 0))
        self.transport = ssh.Transport(channel)
    else:
        self.transport = ssh.Transport(host)
    self.transport.start_client()
    self.transport.auth_password(user, auth)

def run(self, cmd):
    ch = self.transport.open_session()
    ch.set_combine_stderr(True)
    ch.exec_command(cmd)
    retcode = ch.recv_exit_status()
    buf = ''
    while ch.recv_ready():
        buf += str(ch.recv(1024))

    return (buf, retcode)


host = ('192.168.0.136', 22)
via_host = ('192.168.0.213', 22)

ssht = SSHTool(host, …
Run Code Online (Sandbox Code Playgroud)

python ssh telnet paramiko

5
推荐指数
1
解决办法
131
查看次数