]> git.lizzy.rs Git - luairc.git/commitdiff
allow users to manually set the ip address of the connection (so that things like...
authorjluehrs2 <jluehrs2@uiuc.edu>
Mon, 3 Sep 2007 01:11:24 +0000 (20:11 -0500)
committerjluehrs2 <jluehrs2@uiuc.edu>
Mon, 3 Sep 2007 01:11:24 +0000 (20:11 -0500)
src/irc.lua

index ff90c363fc007cf27353cfd76390334b405a31ca..270cd9123119cf9c4f0bf25c416c01c8fa4ebdf5 100644 (file)
@@ -44,6 +44,7 @@ local requestinfo = {whois = {}}
 local handlers = {}
 local ctcp_handlers = {}
 local serverinfo = {}
+local ip = nil
 -- }}}
 
 -- defaults {{{
@@ -934,7 +935,16 @@ end
 -- @return A string representation of the local IP address that the IRC server
 --         connection is communicating on
 function get_ip()
-    return (irc_sock:getsockname())
+    return (ip or irc_sock:getsockname())
+end
+-- }}}
+
+-- set_ip {{{
+---
+-- Set the local IP manually (to allow for NAT workarounds)
+-- @param new_ip IP address to set
+function set_ip(new_ip)
+    ip = new_ip
 end
 -- }}}