aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-09-02 20:11:24 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-09-02 20:11:24 -0500
commit5517a378e4d967ead030aa7d5a73aec807a25a69 (patch)
tree5b808e4ae91af705c4d2edcb599b27c2aa8797d1
parent5fb84d0d2abf669cccd3290192f59a640be5d5df (diff)
downloadluairc-5517a378e4d967ead030aa7d5a73aec807a25a69.tar.gz
luairc-5517a378e4d967ead030aa7d5a73aec807a25a69.zip
allow users to manually set the ip address of the connection (so that things like dcc can use the public ip, rather than the local network ip)
-rw-r--r--src/irc.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/irc.lua b/src/irc.lua
index ff90c36..270cd91 100644
--- a/src/irc.lua
+++ b/src/irc.lua
@@ -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
-- }}}