receive commands by telnet #3058
Replies: 1 comment 3 replies
-
Hi @lowepalma, You can find helpful information about registering the telnet commands on page 152 of the book. As for your example # Define a function that responds "hello" when called and checks the password
def say_hello(password)
if password == "your_password" then
"hello"
else
"Incorrect password"
end
end
# Configure telnet server
settings.server.telnet.set(true)
# settings.server.telnet.revdns.set(false)
# settings.server.telnet.port.set(1234)
# settings.server.telnet.bind_addr.set("127.0.0.1")
# Associate the "hello" command with the say_hello function
server.register("hello", say_hello) If you want to enable the telnet server, then you should use settings instead of According to the function documentation.
Additionally, you can provide
I suggest using |
Beta Was this translation helpful? Give feedback.
-
RELSOLVED !
I need help to understand how liquid soup can receive telnet commands to do functions.
Example but that it works correctly:
#Define a function that responds "hello" when called and checks the password
def say_hello(password) =
if password == "your_password" then
"hello"
else
"Incorrect password"
end
end
#Define the Telnet server and associate the "hello" command with the say_hello function
server = server.telnet(port = 1234)
server.register("hello", say_hello)
Beta Was this translation helpful? Give feedback.
All reactions