mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2003
Posts: 14
B
BrunoJ Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2003
Posts: 14
I have written a script to emulate the standard DCC Chat command using socket commands. It works fine as long as the remote client is on my LAN, but has problems when the remote client is outside the LAN. Here is the flow of the script:

1. Remote user sends a request via msg for the local machine to initiate a DCC Chat.
2. Local machine finds a free port in the range 1024-5000.
3. Local machine does a socklisten on that port.
4. Local machine sends the appropriate raw PRIVMSG containing ip address and port.
5. Remote user sees the standard DCC Chat accept dialog box and accepts the connection.

So far, so good. But here is where it breaks down. The local machine never hears anything on the listening port. I realize the problem is most likely because of the NAT firewall in my router and could simply map a range of ports to the local machine. However, I see that as a work-around and not a fix. MIRC can establish a DCC Chat connection if I initiate it from the local machine using the standard "/dcc chat XXXX" command. So, I should be able to do it by using socket commands in a script.

BTW, I do ensure the correct ip address is sent in the PRIVMSG - NIC address for connections on the LAN and router external address for connections outside the LAN. Like I said, the script works fine when connecting to another machine on my LAN.

Can anyone give me a clue before I pull out what little hair remains on my head?

BrunoJ

Joined: Dec 2002
Posts: 87
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 87
I had this same problem, and, unfortunately, if a remote user is using a NAT, they WILL NOT be able to send to you without allowing proper PORT FORWARDING through their router (assuming they have one). You will have to do this too (I believe if you go to your IE, you can do: http://192.168.0.1 and pull up your configuration).

The reason you can initiate DCC's to yourself is because your NAT on the router notices that you actually REQUESTED this to happen. When a remote user tries to confirm a DCC, your system never receives it as a 'confirmation authentication', because your NAT interrupts it and says "Oh, you didn't request this. DIE!!!!". That's because NATs can be gay sometimes; even though you iniated the send to begin, it doesn't realize that it should be waiting for a request of confirmation. So, it's retarded in a sense ;-)

Anywho, hope this helps you! Good luck!


-Zmodem
Joined: Jul 2003
Posts: 14
B
BrunoJ Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Jul 2003
Posts: 14
I don't think you understand what happens when you initiate a dcc chat using the standard command. Your client sends a PRIVMSG to the remote user thru the servers that contains your ip addy and your listening port. The remote user then makes the connection to you. That is the command implementation standard. However, mIRC must be doing something else to tell my router that remote user connection should be routed to a specific machine. Using the standard command will result in a successful connection thru my router without the need for manually configuring the router with port forwarding. I just need to know what it is doing that I am not emulating. Whether the remote user is using a NAT is immaterial in this case since the real "direct connection" part of the process starts at their end.



Link Copied to Clipboard