Skip to content

Commit 3beee0f

Browse files
committed
Remove hardcoded IP
Replaced hardcoded IP with check for user's IP. Now works for people whose ip addresses are not 192.168.1.141.
1 parent 1afe45d commit 3beee0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

miranda.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def listen(self,size,socket):
172172
return False
173173

174174
#Create new UDP socket on ip, bound to port
175-
def createNewListener(self,ip='192.168.1.141',port=1900):
175+
def createNewListener(self,ip=gethostbyname(gethostname()),port=1900):
176176
try:
177177
newsock = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP)
178178
newsock.setsockopt(SOL_SOCKET,SO_REUSEADDR,1)
@@ -799,7 +799,7 @@ def updateCmdCompleter(self,struct):
799799
def msearch(argc, argv, hp, cycles=99999999):
800800
defaultST = "upnp:rootdevice"
801801
st = "schemas-upnp-org"
802-
myip = '192.168.1.141'
802+
myip = gethostbyname(gethostname())
803803
lport = hp.port
804804

805805
if argc >= 3:

0 commit comments

Comments
 (0)