![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 33 Pomógł: 0 Dołączył: 4.02.2013 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Mam do Was dużą prośbę. Napisałem już architekturę klient/serwer i potrzebuję do tego zaprogramować mocne uwierzytelnienie (wszystko w pythonie). To moje pierwsze kroki w tym języki programowania a język narzucony odgórnie. Pozdrowienia! |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Nieautoryzowani Postów: 2 249 Pomógł: 305 Dołączył: 2.10.2006 Ostrzeżenie: (0%) ![]() ![]() |
Rozumiem, że masz jakieś pytanie, tylko dlaczego jest ono takie tajemnicze?
-------------------- Google knows the answer...
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 33 Pomógł: 0 Dołączył: 4.02.2013 Ostrzeżenie: (0%) ![]() ![]() |
Hej pedro
Heh faktycznie czegoś zapomnialem ![]() Chodzi mi o pomoc w rozwiązaniu problemu uwierzytelnienia napisanego w pythonie, jakieś tutoriale, manuale bądź cokolwiek (może ktoś już takie coś robił i się podzieli). Buszuję po sieci ale jak narazie nic się nie nadaje. |
|
|
![]()
Post
#4
|
|
![]() Grupa: Nieautoryzowani Postów: 2 249 Pomógł: 305 Dołączył: 2.10.2006 Ostrzeżenie: (0%) ![]() ![]() |
Nie robiłem jeszcze w Pythonie czegoś podobnego, ale coś doradzić spróbuję
![]() A może napisz konkretnie co masz, co robisz, może wtedy coś innego się doradzi. -------------------- Google knows the answer...
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 33 Pomógł: 0 Dołączył: 4.02.2013 Ostrzeżenie: (0%) ![]() ![]() |
Bardzo dziękuję za zainteresowanie tematem
![]() Mam serwer (z dokumentacji) Cytat import SocketServer class MyTCPHandler(SocketServer.BaseRequestHandler): """ The RequestHandler class for our server. It is instantiated once per connection to the server, and must override the handle() method to implement communication to the client. """ def handle(self): # self.request is the TCP socket connected to the client self.data = self.request.recv(1024).strip() print "{} wrote:".format(self.client_address[0]) print self.data # just send back the same data, but upper-cased self.request.sendall(self.data.upper()) if __name__ == "__main__": HOST, PORT = "localhost", 9999 # Create the server, binding to localhost on port 9999 server = SocketServer.TCPServer((HOST, PORT), MyTCPHandler) # Activate the server; this will keep running until you # interrupt the program with Ctrl-C server.serve_forever() Oraz klienta Cytat import socket import sys HOST, PORT = "localhost", 9999 data = " ".join(sys.argv[1:]) # Create a socket (SOCK_STREAM means a TCP socket) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: # Connect to server and send data sock.connect((HOST, PORT)) sock.sendall(data + "\n") # Receive data from the server and shut down received = sock.recv(1024) finally: sock.close() print "Sent: {}".format(data) print "Received: {}".format(received) Musze zrobić jeszcze uwierzytelnienie klienta przez hasło, który będzie miał dostęp do jakiejś sesji/zasobów oraz serwer musi trzymać hasze haseł. |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 00:06 |