test.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Wed, 16 Mar 2016 01:53:56 +0200
changeset 66 a40beb82130c
parent 57 37ed3c7ac1b6
permissions -rw-r--r--
node: Use new loudmouth feature - public attribute list (v0.9.7)
23
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     1
--[[ Copyright 2009 Myhailo Danylenko
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     2
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     3
This program is free software: you can redistribute it and/or modify
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     4
it under the terms of the GNU General Public License as published by
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     5
the Free Software Foundation, either version 2 of the License, or
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     6
(at your option) any later version.
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     7
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     8
This program is distributed in the hope that it will be useful,
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
     9
but WITHOUT ANY WARRANTY; without even the implied warranty of
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    11
GNU General Public License for more details.
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    12
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    13
You should have received a copy of the GNU General Public License
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    14
along with this program.  If not, see <http://www.gnu.org/licenses/>. ]]
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    15
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    16
-- Note, this requires glib module, that is not released yet
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    17
-- (and, probably, will not be released ever), thus, this
13f03e604c8a License notes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 22
diff changeset
    18
-- code is provided only as example.
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    20
local g  = require 'glib'
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
local lm = require 'lm'
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
g.log.handler (
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
	function ( domain, lvl, mesg )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
		print ( mesg )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
	end )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    28
local sent = false
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    30
local username, server = arg[1]:match ( '(.+)@(.+)' )
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    31
local password         = arg[2]
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    32
local recipient        = arg[3] or arg[1]
57
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    33
local fingerprint      = arg[4]
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    34
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    35
if not fingerprint then
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    36
	local ssl_fp_format = lm.ssl.supported ()
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    37
	if ssl_fp_format then
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    38
		if ssl_fp_format == 'MD5' then
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    39
			fingerprint = '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    40
		else
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    41
			fingerprint = 'SHA256:0123456789abcdeffedcba98765432100123456789acbdeffedcba9876543210'
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    42
		end
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    43
	end
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
    44
end
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    45
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
    46
print ( ("Connectng to %s with username %s\nWill contact %s."):format ( server, username, recipient ) )
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    48
--[[
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
-- What's goes on, pretty close to C api,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
-- but already some luxury...
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
you_need_your_own_context = true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    52
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    53
if you_need_your_own_context then
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    54
	cont = g.main_context.new ()
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    55
	conn = lm.connection.new ( server, cont:pointer () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    56
else
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    57
	cont = g.main_context.default ()
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    58
	conn = lm.connection.new ( server )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    59
end
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    60
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    61
if lm.ssl.supported () then
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    62
	conn:port ( 5223 )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    63
	conn:ssl ( lm.ssl.new ( fingerprint,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    64
		function (ssl, err)
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    65
			print ( 'SSL error occured: ' .. err )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    66
			print ( 'Fingerprint: ' .. ssl:fingerprint () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    67
			return true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    68
		end ) )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    69
end
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    70
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    71
print ( 'Opening connection... ' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    72
res = conn:open (
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    73
	function ( connection, success )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    74
		if success then
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    75
			print ( "Authenticating..." )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    76
			res = connection:authenticate ( username, password, 'llm-test',
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    77
				function ( connection, success )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    78
					if success then
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    79
						print ( "Sending..." )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    80
						
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    81
						connection:send (
22
1a1bc121fe90 Test gets parameters from build system
Myhailo Danylenko <isbear@ukrpost.net>
parents: 21
diff changeset
    82
							lm.message.new( recipient, 'message' )
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    83
								:child ( 'body', 'Hello, this is just a test' ) )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    84
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    85
						connection:send (
22
1a1bc121fe90 Test gets parameters from build system
Myhailo Danylenko <isbear@ukrpost.net>
parents: 21
diff changeset
    86
							lm.message.new( recipient, 'iq', 'get' )
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    87
								:child( 'query', '' ):attribute ( 'xmlns', 'jabber:iq:version' ),
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    88
							function ( connection, message )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    89
								node = message:child ( 'query' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    90
								print ( 'Got response:' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    91
								print ( '  name:     ', node:child( 'name' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    92
								print ( '  version:  ', node:child( 'version' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    93
								print ( '  os:       ', node:child( 'os' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    94
								sent = true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    95
							end )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    96
					else
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    97
						print ( "Authenticate failure" )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    98
						sent = true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    99
					end
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   100
				end )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   101
			print ( 'Authenticate returns ', res )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   102
		else
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   103
			print ( "Open failure" )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   104
			sent = true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   105
		end
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   106
	end )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   107
print ( 'Open returns ', res )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   108
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   109
--]]
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   110
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   111
-- Shortened version with convenience lua functions:
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   112
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
   113
local conn = lm.connect {
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   114
	server = server,
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
   115
	port   = 5222,
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   116
	ssl    = {
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   117
		fingerprint = fingerprint,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   118
		validate    = false,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   119
	},
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   120
	username = username,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   121
	password = password,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   122
	resource = 'llm-test',
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   123
	onconnect =
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   124
		function ( connection )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   125
			print ( 'connected' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   126
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   127
			connection:send (
22
1a1bc121fe90 Test gets parameters from build system
Myhailo Danylenko <isbear@ukrpost.net>
parents: 21
diff changeset
   128
				lm.message.create { mtype = "message", to = recipient,
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   129
					body = { 'Hello, this is just a test' },
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   130
				} )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   131
			print ( 'sent' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   132
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   133
			connection:send (
22
1a1bc121fe90 Test gets parameters from build system
Myhailo Danylenko <isbear@ukrpost.net>
parents: 21
diff changeset
   134
				lm.message.create { mtype = "iq-get", to = recipient,
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   135
					query = { xmlns = "jabber:iq:version" }
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   136
				},
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   137
				function ( connection, message )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   138
					print ( 'received' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   139
					print ( 'Got response:' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   140
					print ( '   name:     ', message:path( 'query', 'name' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   141
					print ( '   version:  ', message:path( 'query', 'version' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   142
					print ( '   os:       ', message:path( 'query', 'os' ):value () )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   143
					sent = true
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   144
				end )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   145
			print ( 'sent' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   146
		end,
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   147
}
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   148
53
2dcfa81100e4 Some fixes to test
Myhailo Danylenko <isbear@ukrpost.net>
parents: 29
diff changeset
   149
local cont = g.main_context.default ()
21
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   150
print ( 'Entering main loop...' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   151
while not sent do
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   152
	cont:iteration ( true )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   153
end
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   154
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   155
print ( 'Closing connection... ' )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   156
conn:close ()
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   157
print ( "Bye" )
a9b92b65961e Test file :P
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   158
57
37ed3c7ac1b6 ssl: Support for SHA256 fingerprints (v0.9.3)
Myhailo Danylenko <isbear@ukrpost.net>
parents: 53
diff changeset
   159
-- vim: se ts=4 sw=4: --