Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I have a question somewhat similiar to this node. The code over here is the server right? I did not have a chance to code sockets in perl, but Im desperate to remotely execute scripts. And moreover, I don't have any idea regarding DMZ etc.
Suppose I have a port 8080 open in my Windows machine, would I be able to connect to it using a socket, if so, how can I do that?
Also, will there be a problem because of this dmZ?

Thanks in advance.

Title edit by tye

  • Comment on Can I execute scripts remotely using Perl sockets in Windows?

Replies are listed 'Best First'.
Re: Sockets
by tachyon (Chancellor) on Sep 25, 2003 at 07:59 UTC

    Do you have a DMZ? Do you have a firewall? Do you have control over these, if they exist? Remote as in across the Internet? Remote as in across the local LAN?

    A server will listen on a specific port for connections. You can write a server in Perl and there are plenty of examples. Use Super Search. In order to connect to this server remotely you need to be able to 'SEE' this port from the remote machine. Lets assume no firewall, and across Internet:

    Win32 Server on 1.2.3.4 <------- connect 1.2.3.4:8080

    As soon as you add firewalls you need to have two things occur. You need to map from the external IP the intenal IP and allow connections on the target port:

    Server 10.0.0.1 <--- DMZ/FW 1.2.3.4 <----- connect 1.2.3.4:8080

    It's anyone's guess if you will be able to connect through a firewall/DMZ. Not unless it is specifically configured to allow it in all liklihood.

    What is it you need to remotely execute. There may well be a pre written solution to your problems.....

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      There are some nightly batch jobs that run in some machines. There might be a situation that I have to manually run the batch during the day. That was why I was thinking of using perl socket-server module that would help.

      Most of the machines are in the network.. One or two of the machines are main servers, so they might contain a firewall.

      Are there pre-written solutions for the above?
      Thanks.

        You don't need perl for this. It is easy to remotely exec stuff on Win32 machines within a network (provided we are talking NT/2000/XP). Here is a pre-rolled shareware solution that worked last time I looked: RemoteExec

        Internal network servers are unlikely to be firewalled off (Win32 depends on all sort of ports being open to function), although you may of course have permissions issues.

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        If they do contain firewalls, you are probably going to run into problems. I have got a similar problem before where the firewall allowed checking of email enabled, so wrote a script to check a particular pop email account every 1/2 hour or so. If I wanted to do something I would just email a specially formatted email to the address and the program would pick it up and do its job. Not the safest way of doing things perhaps, but a good work around for me. Regards, Gerard