This project is read-only.

How to set proxy support sample?

Jan 7, 2014 at 2:15 AM
I have the following piece of code:

IPAddress ip;
        if (IPAddress.TryParse(proxyhost, out ip))
            EndPoint proxy = new IPEndPoint(ip, proxyport);
            SuperSocket.ClientEngine.Proxy.Socks5Connector prx = new SuperSocket.ClientEngine.Proxy.Socks5Connector(proxy);

            _socket = new WebSocket(WebsocketServerUrl);
    _socket.Proxy = prx as SuperSocket.ClientEngine.IProxyConnector;

            _socket.Opened += onSocketOpened;
            _socket.Error += onSocketError;
            _socket.MessageReceived += onSocketMessage;
            _socket.Closed += onSocketClosed;
            _ping.Elapsed += onPing;
            _ping.Enabled = true;

            Received += internalHandler;
The connection won't go through the socks5 proxy, but will connect directly. Am I doing something wrong here?

Thank you
Jan 7, 2014 at 3:30 AM
I think I haven't implemented the socks5 proxy. I am sorry for that. Could you try socks4/4a instead?
Jan 7, 2014 at 5:46 AM
Unfortunately, the behaviour is exactly the same. Straight through, as if the proxy was never declared.
No exception is thrown.
I was thinking that maybe I'm not declaring the proxy in a correct way or something.
I am using the binary build in Mono environment.

Thank you
Jan 7, 2014 at 5:58 AM
What's the exception?
Jan 7, 2014 at 6:00 AM
No exception is thrown.
Jan 7, 2014 at 6:46 AM
I suggest you enable networktrace to check the network activities detail:
Jan 10, 2014 at 9:25 AM
The problem seems to be here:
_socket.Proxy = prx as SuperSocket.ClientEngine.IProxyConnector;

_socket.Proxy is still (null) even if prx is intialized correctly. Conversion to IProxyConnector is not ok like this apparently.
Jan 10, 2014 at 11:14 AM
Which version are you using? Could you try the latest source code in the repository?