Cómo establecer una conexión con el servidor de Homebrew


First, my host is dreamhost. I have root access. The system is a linux system.


**UPDATE: It looks like the server uses modsecurity (modsecurity.org). I'll look into it more now, but if anyone has any tips or knows how to work with it, that's where I'm stuck now. **

Second, I wrote a java server that binds to port #### and the listens for connections. I can run this local & connect, but I'm trying to put it up on my server and connect from anywhere. That is the idea behind a server.

    private int port;
    private ServerSocketChannel ssc;
    private Selector selector;

    public Server(int port) {
        this.port = port;               

    public void run() {
        try {
            ssc = ServerSocketChannel.open();           
            selector = Selector.open();
            ssc.socket().bind((new InetSocketAddress(port)));       

            new Thread(new ReadLoop(selector)).start();
            new Thread(new AcceptingLoop(ssc, selector)).start();

            System.out.println("Bound to port " + port + " and awake:");
        } catch (IOException e) {
            System.out.println("Server could not start.");

I launched this on the server. The program says it successfully bound to the port.


The client is flash, AS3. Here's the code i use to attempt the connect:

var mySocket:XMLSocket = new XMLSocket();
mySocket.connect("http://mydomain.net", ####);

I'm well aware of the sandbox policies. This is something else. I receive this error:

IOERROR [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: http:--mydomain.net"] (replace -- with //, stackoverflow was reading it as a link)

This error apparently means that Flash never found a server. I would have gotten a security error if it had been the sandbox.

Anyway, how do I tell if ports are open correctly, if they are blocked, etc?

I'm also wondering if this has something to do with it: http://wiki.dreamhost.com/Mod_security

I unfortunately don't understand a lot of this stuff, but I'm trying to learn.

preguntado el 08 de enero de 11 a las 16:01

can you connect from the command line of the client machine ? If the client machine is windows you should open a command prompt and run telnet mydomain.net #### (your port). This will try to open an connection to your server. If this works then something is broken with the flash setup. If not then you need to look at the network setup on the server side. -

I cannot connect that way. Recieved: Could not open connection to the host, on port ####: Connect failed -

1 Respuestas

Try and run your server program on a port that is unlikely to be blocked (e.g. 80, 443). Of course, make sure that nothing else is using the port that you choose.

Respondido 19 Abr '13, 08:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.