summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modules/webrepl.py
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266/modules/webrepl.py')
-rw-r--r--esp8266/modules/webrepl.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/esp8266/modules/webrepl.py b/esp8266/modules/webrepl.py
index da3e70c595..5a76e9b26d 100644
--- a/esp8266/modules/webrepl.py
+++ b/esp8266/modules/webrepl.py
@@ -31,6 +31,10 @@ def setup_conn(port, accept_handler):
def accept_conn(listen_sock):
global client_s
cl, remote_addr = listen_sock.accept()
+ if uos.dupterm():
+ print("\nConcurrent WebREPL connection from", remote_addr, "rejected")
+ cl.close()
+ return
print("\nWebREPL connection from:", remote_addr)
client_s = cl
websocket_helper.server_handshake(cl)
@@ -55,18 +59,16 @@ def start(port=8266, password=None):
stop()
if password is None:
try:
- import port_config
- _webrepl.password(port_config.WEBREPL_PASS)
+ import webrepl_cfg
+ _webrepl.password(webrepl_cfg.PASS)
setup_conn(port, accept_conn)
print("Started webrepl in normal mode")
except:
- import webrepl_setup
- setup_conn(port, webrepl_setup.handle_conn)
- print("Started webrepl in setup mode")
+ print("WebREPL is not configured, run 'import webrepl_setup'")
else:
_webrepl.password(password)
setup_conn(port, accept_conn)
- print("Started webrepl in normal mode")
+ print("Started webrepl in manual override mode")
def start_foreground(port=8266):