Skip to content

Commit

Permalink
fixing urls problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaaoBlues committed Jun 24, 2022
1 parent fb66ecc commit 4ea50ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions copypasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def check_exe_name():

# copypasta url

if not is_hosts_file_modified():
if is_hosts_file_modified():

COPYPASTA_URL = "copypasta.me" if system() == "Windows" else "copypasta.me:21987"
COPYPASTA_URL = "http://copypasta.me" if system() == "Windows" else "http://copypasta.me:21987"

else:

Expand Down
19 changes: 12 additions & 7 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,24 @@ def get_server_version():


def add_copypasta_port_redirect():

if system() == "Windows":

# re-put port redirect from 127.0.0.1:80 to 127.0.0.1:80
run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=21987 connectaddress=127.0.0.1")

# put port redirect from 127.0.0.1:21987 to 127.0.0.1:80
try:
run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=21987 connectaddress=127.0.0.1")
except:
# feature that may crash sometimes, not essential
pass


def remove_copypasta_port_redirect():

if system() == "Windows":

# re-put port redirect from 127.0.0.1:80 to 127.0.0.1:80
run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=80 connectaddress=127.0.0.1")


try:
run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=80 connectaddress=127.0.0.1")
except:
# feature that may crash sometimes, not essential
pass

0 comments on commit 4ea50ae

Please sign in to comment.