mirror of
				https://github.com/kepler155c/opus
				synced 2025-10-31 07:33:00 +00:00 
			
		
		
		
	socket.lua: Option to pass user generated keypairs
This commit is contained in:
		| @@ -126,7 +126,11 @@ function Socket.connect(host, port, options) | |||||||
|  |  | ||||||
| 	local socket = newSocket(host == os.getComputerID()) | 	local socket = newSocket(host == os.getComputerID()) | ||||||
| 	socket.dhost = tonumber(host) | 	socket.dhost = tonumber(host) | ||||||
| 	socket.privKey, socket.pubKey = network.getKeyPair() | 	if options and options.keypair then | ||||||
|  | 		socket.privKey, socket.pubKey = unpack(options.keypair) | ||||||
|  | 	else | ||||||
|  | 		socket.privKey, socket.pubKey = network.getKeyPair() | ||||||
|  | 	end | ||||||
| 	local identifier = options and options.identifier or Security.getIdentifier() | 	local identifier = options and options.identifier or Security.getIdentifier() | ||||||
|  |  | ||||||
| 	socket.transmit(port, socket.sport, { | 	socket.transmit(port, socket.sport, { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Anavrins
					Anavrins