mirror of
https://github.com/kepler155c/opus
synced 2025-01-30 17:14:46 +00:00
socket.lua: Option to pass user generated keypairs
This commit is contained in:
parent
6204c46cc4
commit
9e3cf50ccc
@ -126,7 +126,11 @@ function Socket.connect(host, port, options)
|
||||
|
||||
local socket = newSocket(host == os.getComputerID())
|
||||
socket.dhost = tonumber(host)
|
||||
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()
|
||||
|
||||
socket.transmit(port, socket.sport, {
|
||||
|
Loading…
Reference in New Issue
Block a user