Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
Tayfun ULU 8c2c3b1acf
closing AP after connection
disable AP mode after connection
2022-12-31 12:10:22 +03:00
Tayfun ULU f60cf8f5bb
Update wifimgr.py
to solve windows chrome. tested both now. it's ok
2022-12-31 12:07:45 +03:00
Tayfun ULU 92594fc085
Merge pull request #26 from ColinNg/fix-parameters-in-Safari-on-macOS-and-iOS
Fix parameters in Safari on macOS and iOS
2022-12-31 10:17:55 +03:00
Colin Ng 8e92966aec Fix parameters in Safari on macOS and iOS by reading the form data which appears after `\r\n\r\n` (HTTP POST data was verified with WireShark). 2020-09-22 03:43:34 -07:00
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -94,6 +94,7 @@ def do_connect(ssid, password):
print('.', end='')
if connected:
print('\nConnected. Network config: ', wlan_sta.ifconfig())
wlan_ap.active(False)
else:
print('\nFailed. Not Connected to: ' + ssid)
return connected
@ -275,6 +276,7 @@ def start(port=80):
while True:
if wlan_sta.isconnected():
wlan_ap.active(False)
return True
client, addr = server_socket.accept()
@ -289,6 +291,13 @@ def start(port=80):
except OSError:
pass
# Handle form data from Safari on macOS and iOS; it sends \r\n\r\nssid=<ssid>&password=<password>
try:
request += client.recv(1024)
print("Received form data after \\r\\n\\r\\n(i.e. from Safari on macOS or iOS)")
except OSError:
pass
print("Request is: {}".format(request))
if "HTTP" not in request: # skip invalid requests
continue