Skip to content

Commit

Permalink
Merge pull request #22 from ThaaoBlues/main
Browse files Browse the repository at this point in the history
1.6.4
  • Loading branch information
ThaaoBlues authored Jun 24, 2022
2 parents 0111ef1 + f021e2a commit 177a01e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions copypasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def check_exe_name():

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:

COPYPASTA_URL = "127.0.0.1:21987"
COPYPASTA_URL = "http://127.0.0.1:21987"

#necessary to update images (stack overflow)
@app.after_request
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
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.3
1.6.4

0 comments on commit 177a01e

Please sign in to comment.