[GH-ISSUE #39] 277行改成 ip = request.urlopen('https://api.ip.sb/ip').readline(),要不然报错 #23

Open
opened 2026-03-03 13:50:34 +03:00 by kerem · 3 comments
Owner

Originally created by @Mpk2022 on GitHub (Jun 8, 2022).
Original GitHub issue: https://github.com/inpanel/inpanel/issues/39

def detect_ip(self):
    ip = request.urlopen('https://api.ip.sb/ip').readline()
    return ip
Originally created by @Mpk2022 on GitHub (Jun 8, 2022). Original GitHub issue: https://github.com/inpanel/inpanel/issues/39 def detect_ip(self): ip = request.urlopen('https://api.ip.sb/ip').readline() return ip
Author
Owner

@jksdou commented on GitHub (Apr 12, 2023):

后续优化此功能,待定

<!-- gh-comment-id:1504920168 --> @jksdou commented on GitHub (Apr 12, 2023): 后续优化此功能,待定
Author
Owner

@Clancy6 commented on GitHub (Aug 5, 2024):

已经暴雷了:

Traceback (most recent call last):
  File "install.py", line 392, in <module>
    install.install()
  File "install.py", line 381, in install
    print('\033[4;34mhttp://%s:%s/\033[0m' % (self.detect_ip(), self.listen_port))
  File "install.py", line 277, in detect_ip
    ip = request.urlopen('http://ip.42.pl/raw').readline()
……
socket.error: [Errno 104] Connection reset by peer
<!-- gh-comment-id:2269189430 --> @Clancy6 commented on GitHub (Aug 5, 2024): 已经暴雷了: ``` Traceback (most recent call last): File "install.py", line 392, in <module> install.install() File "install.py", line 381, in install print('\033[4;34mhttp://%s:%s/\033[0m' % (self.detect_ip(), self.listen_port)) File "install.py", line 277, in detect_ip ip = request.urlopen('http://ip.42.pl/raw').readline() …… socket.error: [Errno 104] Connection reset by peer ```
Author
Owner

@jksdou commented on GitHub (Aug 5, 2024):

@Clancy6 好的

<!-- gh-comment-id:2270051481 --> @jksdou commented on GitHub (Aug 5, 2024): @Clancy6 好的
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/inpanel#23
No description provided.