TCP/IP and internet protocols
Web (HTTP) client
- VARIANT FUNCTION CallJSONRPC(STRING url, STRING methodname, VARIANT ARRAY arguments)
Executes a JSON RPC call, allocates webbrowser as needed
- OBJECTTYPE WebBrowser
Utility class to communicate with HTTP servers
URL manipulation
- STRING FUNCTION AddVariableToUrl(STRING url, STRING varname, STRING varvalue)
Rewrite an URL to add a variable
- STRING FUNCTION DeleteVariableFromUrl(STRING url, STRING varname)
Rewrite an URL to remove a variable
- RECORD ARRAY FUNCTION GetAllVariablesFromUrl(STRING url)
Get all variable on a URL
- STRING FUNCTION GetDataUrl(BLOB filedata, STRING filetype)
Construct a data URL for a given file
- STRING FUNCTION GetHostNameFromURL(STRING url)
Derive the hostname from a URL
- STRING FUNCTION GetPathFromURL(STRING url)
Get the path from a URL
- INTEGER FUNCTION GetPortFromURL(STRING url)
Derive the port number from a url
- STRING FUNCTION GetProtocolFromURL(STRING url)
Returns the protocol from an URL
- INTEGER FUNCTION GetSchemeDefaultPort(STRING scheme)
Returns the default port for an URL scheme
- STRING FUNCTION GetVariableFromUrl(STRING url, STRING varname)
Get the value of a variable from a URL
- BOOLEAN FUNCTION IsAbsoluteURL(STRING url)
Is this URL absolute ?
- BOOLEAN FUNCTION IsValidHostname(STRING hostname)
Check if a hostname is valid
- BOOLEAN FUNCTION IsValidPlainHTTPURL(STRING url)
Test whether an URL is a valid HTTP url
- BOOLEAN FUNCTION IsValidURL(STRING url)
Test whether an URL is a valid url
- STRING FUNCTION MakeRelativeLinkFromURL(STRING current_url, STRING convert_url, STRING scope)
Convert an absolute URL to a relative one, if at all possible
- RECORD FUNCTION ParseDataURL(STRING inurl)
Parses a data url (URL that looks like 'data:....')
- STRING FUNCTION RepackURL(RECORD unpackedurl)
Repack a split URL back into a string
- STRING FUNCTION ReplaceVariableInUrl(STRING url, STRING overridevar, STRING overridevalue)
Rewrite an URL to replace an existing variable
- STRING FUNCTION ResolveToAbsoluteURL(STRING baseurl, STRING newurl)
Rewrite an URL to make it absolute
- RECORD FUNCTION UnpackURL(STRING inurl)
Unpack a URL into its parts
- STRING FUNCTION UpdateURLVariables(STRING inurl, RECORD replacements)
Update the variables in a URL with the cells in a record
TCP/IP connections
- INTEGER FUNCTION AcceptOnTCPSocket(INTEGER connectionid)
Accept an incoming connection on a TCP/IP socket
- OBJECT FUNCTION AsyncConnectSocket(INTEGER connectionid, STRING host, INTEGER port)
Asynchronously connect a TCP/IP socket to an IP address and/or a port
- BOOLEAN FUNCTION BindSocket(INTEGER connectionid, STRING host, INTEGER port)
Bind a TCP/IP socket to an IP address and/or a port
- STRING FUNCTION CanonicalizeIPAddress(STRING address, BOOLEAN with_prefixlength)
Convert an IP address to its shortest, least ambiguous format
- MACRO CloseSocket(INTEGER connectionid)
Close a TCP/IP socket and free its associated data
- BOOLEAN FUNCTION ConnectSocket(INTEGER connectionid, STRING host, INTEGER port)
Connect a TCP/IP socket to an IP address and/or a port
- OBJECT FUNCTION CreateSocket(STRING type)
Creates a new socket
- INTEGER FUNCTION CreateTCPSocket()
Create a new TCP socket
- INTEGER FUNCTION CreateUDPSocket()
Create a new UDP socket
- CONSTANT STRING default_ciphersuites
List of cyphersuites supported by modern browers. Taken from the current internet.nl requirementsand . Full compliance also requires at least webhare/proxy:2.1.0.
- STRING FUNCTION FormatSocketAddress(STRING ip, INTEGER port)
Correctly formats a socket address (surrounding IPv6 addresses with [])
- INTEGER FUNCTION GetLastSocketError(INTEGER connectionid)
Get the last error on a TCP/IP socket
- STRING FUNCTION GetLastSocketErrorMessage(INTEGER connectionid)
Get the message for the last error on a TCP/IP socket. Also returns SSL error messages (which are not reflected in the error code)
- STRING ARRAY FUNCTION GetLocalIPs()
Returns the list of IP addresses of this machine
- STRING FUNCTION GetLocalSocketIP(INTEGER connectionid)
GetLocalSocketIP is used to get the local IP address from an open connection
- INTEGER FUNCTION GetLocalSocketPort(INTEGER connectionid)
GetLocalSocketPort is used to get the local port number from an open connection
- STRING FUNCTION GetRemoteSocketIP(INTEGER connectionid)
GetRemoteSocketIP is used to get the remote ip address from an open connection
- INTEGER FUNCTION GetRemoteSocketPort(INTEGER connectionid)
GetRemoteSocketPort is used to get the remote port number from an open connection
- STRING FUNCTION GetSocketErrorText(INTEGER errorcode)
Convert a TCP/IP socket error to text
- STRING FUNCTION GetSocketPeerCertificateChain(INTEGER connectionid)
Returns the PEM-encoded certificate chain of the peer. Due tot the current design of the SSL code, some data need to be have been received before the SSL connection has been setup fully, and the peer certificate is available.
- INTEGER FUNCTION GetSocketSendBufferSize(INTEGER connid)
Retuyrns the send buffer size of a socket
- INTEGER FUNCTION GetSocketTimeout(INTEGER connectionid)
Get the timeout used for sending and receiving calls
- STRING FUNCTION GetSystemHostName(BOOLEAN completehostname)
Get the system's host name
- BOOLEAN FUNCTION IsIPAddressWithinPrefix(STRING ip, STRING networkprefix)
Returns whether an IP adress lies within a network prefix
- BOOLEAN FUNCTION IsPrivateIPAddress(STRING address)
Is an address a private IP address? (localhost or other private space)
- BOOLEAN FUNCTION IsValidIPAddress(STRING address)
Is a string a valid IP address?
- BOOLEAN FUNCTION IsValidIPV4Address(STRING address)
Returns whether the specified address is a valid IPv4 address
- BOOLEAN FUNCTION IsValidIPV6Address(STRING address)
Returns whether the specified address is a valid IPv6 address
- BOOLEAN FUNCTION ListenOnTCPSocket(INTEGER connectionid)
Listen on a TCP/IP sockets for incoming connections
- CONSTANT STRING modern_ciphersuites
List of currently safe ciphersuites supported by Mozilla. Taken from the current internet.nl requirementsand . Full compliance also requires at least webhare/proxy:2.1.0. modern_ciphersuites will not support IE11 on win8.1 and below
- STRING FUNCTION ReadFromSocket(INTEGER connectionid)
Receive is used to receive data from a socket
- RECORD FUNCTION ReceiveSocketUDP(INTEGER connectionid)
UDPReceive is used to receive a datagram over UDP
- STRING FUNCTION ResolveHostname(STRING hostname)
Resolve a hostname to an IP address
- STRING ARRAY FUNCTION ResolveHostnameAllIPs(STRING hostname)
Returns all IP address es for a hostname, Ipv4 and IPv6
- STRING FUNCTION ResolveIPAddress(STRING ip)
Resolve an IP address to a hostname
- CONSTANT RECORD secureconnection_options
Default options for secure connections
- CONSTANT RECORD secureconnection_optionsmeta
Default meta-options for secure connections
- BOOLEAN FUNCTION SendSocketUDP(INTEGER connectionid, STRING remoteip, INTEGER remoteport, STRING data)
UDPSend is used to send a datagram over UDP
- BOOLEAN FUNCTION SetSecureConnection(INTEGER connectionid, BOOLEAN initiate, RECORD options)
Make a current TCP connection secure using SSL
- MACRO SetSocketSendBufferSize(INTEGER connid, INTEGER buffersize)
Sets the send buffer size of a socket
- MACRO SetSocketTimeout(INTEGER connectionid, INTEGER timeout)
Set the timeout used for sending and receiving calls
- MACRO ShutdownSocket(INTEGER connectionid, BOOLEAN shutdownread, BOOLEAN shutdownwrite)
Shutdown a TCP socket (it will still need a CloseSocket call)
SOAP
- OBJECTTYPE SoapClient
Soap client, discovery-based API to access services described by http-accessible WSDLs.
- OBJECTTYPE SoapWSDLFault
- OBJECTTYPE WSDLModifications
Email protocols
- MACRO AbortPop3Account(INTEGER connectionid)
This function will close the connection to the POP3 server without deleting the marked files
- RECORD FUNCTION AddAttachmentsToMail(RECORD toppart, RECORD ARRAY attachments)
Add attachments to a mail record
- RECORD FUNCTION AddEmailHeaders(RECORD origemail)
Adds email MIME headers to an email
- MACRO CloseIMAPAccount(INTEGER connectionid)
This function will close the connection to the IMAP server
- MACRO ClosePop3Account(INTEGER connectionid)
This function will close the connection to the POP3 server
- MACRO ClosePop3AccountWithoutDeleting(INTEGER connectionid)
This function will close the connection to the POP3 server, but will not allow the POP server to delete retrieved/deleted messages
- MACRO CloseSMTPConnection(INTEGER connectionid)
This function will close the connection to the SMTP server
- BOOLEAN FUNCTION CopyIMAPEmail(INTEGER connectionid, INTEGER uid, STRING srcmailfolder, STRING dstmailfolder)
This function will copy an email
- BOOLEAN FUNCTION CreateIMAPMailfolder(INTEGER connectionid, STRING foldername)
This function will create a mail folder on the IMAP server
- INTEGER FUNCTION CreateMimeDecoder(RECORD ARRAY headers, STRING defaultcontenttype)
Set up a MIME message decoder
- RECORD FUNCTION CreateMIMEMailingTopPart(BLOB plainmail, BLOB htmlmail, RECORD ARRAY mail_images)
Create a top part for a MIME mailing
- STRING FUNCTION CreateNewMessageId(STRING hostname)
This function generates a likely unique message id
- INTEGER FUNCTION CreateSMTPConnection(STRING server, INTEGER serverport, INTEGER timeout)
This function will try to create a connection to an SMTP server
- STRING FUNCTION DecodeMBase64(STRING coded)
- STRING FUNCTION DecodeMimeEncodedWords(STRING value)
This function will decode a string with encoded words
- RECORD ARRAY FUNCTION DecodeMIMEHeader(STRING headerstring)
Decode a mime header
- RECORD ARRAY FUNCTION DecodeMIMEHeaderFromBlob(BLOB message)
Decode a mime header from a message blob
- RECORD FUNCTION DecodeMIMEMessage(BLOB message)
- STRING FUNCTION DecodeMUTF7(STRING coded)
this function decodes modified UTF-7 (used for imap foldernames) to UTF-8
- STRING FUNCTION DecodeUCS2(STRING coded)
- BOOLEAN FUNCTION DeleteIMAPEmail(INTEGER connectionid, STRING mailbox, INTEGER uid)
This function will delete an email
- BOOLEAN FUNCTION DeleteIMAPMailFolder(INTEGER connectionid, STRING mailfolder)
This function will delete a mail folder
- BOOLEAN FUNCTION DeletePop3Email(INTEGER connectionid, INTEGER message)
Open a message (email) from the POP3 server
- BLOB FUNCTION EncodeMIMEMessage(RECORD ARRAY headers, RECORD toppart, RECORD options)
Encode a message in MIME format
- STRING FUNCTION EncodeMIMEWords(STRING value)
This function will encode a word when necessary to (=?...?=)
- STRING FUNCTION EncodeMUTF7(STRING uncoded)
this function encodes UTF-8 to modified UTF-7 (used for imap foldernames)
- STRING FUNCTION EncodeUCS2(STRING uncoded)
- RECORD FUNCTION FinishMimeData(INTEGER mimeid)
- RECORD FUNCTION GetEmailPrimaryMIMEPart(RECORD bodystruct, STRING mimetype)
- STRING FUNCTION GetFilenameForMIMEPart(RECORD attachment)
Generate a filename for an attachment
- RECORD FUNCTION GetIMAPBodyStructure(INTEGER connectionid, STRING mailfolder, INTEGER uid)
- RECORD ARRAY FUNCTION GetIMAPEmaillisting(INTEGER connectionid, STRING mailfolder)
This function will get a listing with emails in the specified mail folder
- RECORD ARRAY FUNCTION GetIMAPEmailListingByUids(INTEGER connectionid, STRING mailfolder, INTEGER ARRAY uids, BOOLEAN flags_only)
- BLOB FUNCTION GetIMAPEmailSource(INTEGER connectionid, STRING mailfolder, INTEGER uid, STRING section)
- STRING FUNCTION GetIMAPError(INTEGER connectionid)
This function will check and clear the last error that occured (if any)
- RECORD ARRAY FUNCTION GetIMAPMailfolders(INTEGER connectionid, STRING mailfolder)
This function will get a flat listing of available mail folders (recursive)
- RECORD ARRAY FUNCTION GetIMAPMailSubFolders(INTEGER connectionid, STRING rootfolder)
This function will get a listing of the mail folders within below a certain folder (non-recursive)
- RECORD FUNCTION GetIMAPMimePart(INTEGER connectionid, STRING mailfolder, INTEGER uid, STRING section)
- RECORD ARRAY FUNCTION GetIMAPMimePartHeaders(INTEGER connectionid, STRING mailfolder, INTEGER uid, STRING section)
- RECORD FUNCTION GetIMAPMimeRawPart(INTEGER connectionid, STRING mailfolder, INTEGER uid, STRING section)
- INTEGER ARRAY FUNCTION GetIMAPUidListing(INTEGER connectionid, STRING mailfolder, INTEGER minuid, STRING flags)
This function returns the UIDs of the messages in a folder
- STRING FUNCTION GetMIMEHeader(RECORD ARRAY header, STRING field_)
This function will get the first occurance of a field from a MIME header
- STRING FUNCTION GetMIMEHeaderParameter(STRING data, STRING keyword)
This function will get a parameter from a MIME header (like "attachment; filename=image.jpg")
- STRING FUNCTION GetMIMEHeaderStringFromBlob(BLOB message)
- RECORD ARRAY FUNCTION GetPop3MailListing(INTEGER connectionid)
This function will list the emails in the inbox and download their headers
- RECORD ARRAY FUNCTION GetPop3MailOverview(INTEGER connectionid)
This function will list the emails in the inbox
- BLOB FUNCTION GetPop3RawEmailData(INTEGER connectionid, INTEGER message)
This function downloads a raw POP3 email message
- RECORD FUNCTION GetPop3UIDList(INTEGER connectionid)
Get a listing of all UIDs for all messages from the POP3 server
- RECORD ARRAY FUNCTION GetSMTPEmailHeader(STRING mailfrom, STRING subject, STRING hostname)
Create a basic email header
- RECORD FUNCTION GetSMTPError(INTEGER connectionid)
This function will check and clear the last error that occured
- RECORD ARRAY FUNCTION GetSubscribedIMAPMailboxes(INTEGER connectionid)
This function will get a flat listing of subscribed mail folders (recursive)
- BOOLEAN FUNCTION ImapConnectionAlive(INTEGER connectionid)
This function checks if a IMAP connection is still alive
- MACRO ImapDebugLog(STRING str)
- INTEGER ARRAY FUNCTION IMAPSimpleSearch(INTEGER connectionid, STRING mailfolder, STRING ARRAY searchphrases)
This function will search for a string inside message headers and bodies
- FUNCTION PTR imap_debuglogptr
- BOOLEAN FUNCTION IsValidEmailAddress(STRING emailaddress)
Check if an email address is valid
- BOOLEAN FUNCTION IsValidModernEmailAddress(STRING emailaddress)
Check if an email address is valid in modern times
- STRING FUNCTION MakeEmailAddress(STRING name, STRING email, RECORD options)
Generate a full email address containing name and email
- MACRO MIMEEncodeQP(STRING ARRAY lines, MACRO PTR receivefunction)
This function will encode a mime body
- BOOLEAN FUNCTION MIMEHeaderExists(RECORD ARRAY header, STRING field_)
This function reterns whether a particular field exists in the MIME header
- BOOLEAN FUNCTION MoveIMAPEmail(INTEGER connectionid, INTEGER uid, STRING srcmailfolder, STRING dstmailfolder)
This function will move a mail folder
- INTEGER FUNCTION OpenImapAccount(STRING serverip, INTEGER serverport, STRING username, STRING passwd)
This function will try to login to a IMAP server
- RECORD FUNCTION OpenIMAPEmail(INTEGER connectionid, STRING mailfolder, INTEGER uid)
This function will open a message (email) from the IMAP server
- INTEGER FUNCTION OpenPop3Account(STRING server, INTEGER serverport, STRING username, STRING passwd)
This function will try to login on a POP3 server
- RECORD FUNCTION OpenPop3Email(INTEGER connectionid, INTEGER message)
This function will open a message from the POP3 server
- RECORD ARRAY FUNCTION OpenPop3EmailHeader(INTEGER connectionid, INTEGER message)
Opens the header of a message from the POP3 server
- INTEGER FUNCTION OpenSecureImapAccount(STRING serverip, INTEGER serverport, STRING username, STRING passwd)
This function will try to login to a secure IMAP server
- INTEGER FUNCTION OpenSecurePop3Account(STRING server, INTEGER serverport, STRING username, STRING passwd)
This function will try to login to a secure POP3 server
- BOOLEAN FUNCTION OverwriteIMAPEmailFlags(INTEGER connectionid, STRING mailbox, INTEGER uid, STRING ARRAY flags)
This function will overwrite all flags for an email
- DATETIME FUNCTION ParseImapDateTime(STRING data)
- STRING ARRAY FUNCTION ParseLinePartsFromParser(OBJECT parser)
- MACRO Pop3DebugLog(STRING str)
- FUNCTION PTR pop3_debuglogptr
- RECORD FUNCTION PreEncodeMIMEPart(STRING contentid, STRING mimetype, STRING description, BLOB data, STRING filename, BOOLEAN inline)
- STRING FUNCTION PrettyFormatEmailAddress(STRING address)
- STRING ARRAY FUNCTION PrettyFormatEmailAddresses(STRING ARRAY addresses)
- BOOLEAN FUNCTION RenameIMAPMailFolder(INTEGER connectionid, STRING oldpathname, STRING newpathname)
This function will rename a mail folder
- STRING ARRAY FUNCTION RetokenizeEmailAddresses(STRING ARRAY addresslists)
Re-tokenize a list of email addresses
- OBJECTTYPE RFC2822Parser
- MACRO SendMIMEHeaderTo(RECORD ARRAY headers, MACRO PTR receivefunction, RECORD options)
Encode a header in MIME format
- MACRO SendMIMEMessageTo(RECORD ARRAY headers, RECORD toppart, MACRO PTR receivefunction, RECORD options)
Encode a message in MIME format
- RECORD FUNCTION SendSMTPCustomCommand(INTEGER serverid, STRING cmd)
- RECORD FUNCTION SendSMTPMessage(INTEGER connectionid, STRING ARRAY receivers, STRING sender, RECORD ARRAY mimeheaders, RECORD toppart)
This function will send a message to the SMTP server
- RECORD FUNCTION SendSMTPSingleMessage(STRING mailserver, STRING mailfrom, STRING ARRAY mailto, STRING ARRAY mailcc, STRING ARRAY mailbcc, STRING subject, STRING messagetext, RECORD ARRAY attachments)
Simple mail send function
- BOOLEAN FUNCTION SetIMAPEmailFlags(INTEGER connectionid, STRING mailbox, INTEGER uid, STRING flag, BOOLEAN setflag)
This function will switch a specific flag on or off
- BOOLEAN FUNCTION SetIMAPMailBoxSubscriptionStatus(INTEGER connectionid, STRING mailfolder, BOOLEAN subscribed)
This function will changed the subscribed status of a mail folder
- OBJECTTYPE SMTPConnection
Handles an SMTP connection to a server
- RECORD FUNCTION SplitEmailName(STRING address)
Split an email receiver or sender into email address and full name parts
- RECORD ARRAY FUNCTION SquashEmailMimeData(RECORD email)
- STRING ARRAY FUNCTION TokenizeEmailAddresses(STRING AddressList)
Tokenize email addresses
- RECORD ARRAY FUNCTION TokenizeEmailAddressList(STRING list, BOOLEAN keep_groups)
Tokenizes an email address list Parsed forms : 'norton, andy andy@norton.com' 'andy(de rogue) <(Dit )is a (nested) comment with a ',')andy@[10.8.3.5]>' 'andy@norton.com' 'andy@norton.com (Norton, Andy)'
- RECORD FUNCTION UploadIMAPBlobMessage(INTEGER connectionid, STRING foldername, BLOB message, DATETIME internaldate, STRING ARRAY flags)
This function will send a message-blob to a IMAP-folder.
File transfer (FTP, SMB, SFTP)
- BOOLEAN FUNCTION ChangeFTPDirectory(INTEGER connectionid, STRING directory)
This function will change the working directory on the ftp server
- MACRO CloseFTPConnection(INTEGER connectionid)
Close the connection to the ftp server
- INTEGER FUNCTION CreateFTPConnection(STRING serverip, INTEGER serverport, STRING username, STRING passwd, BOOLEAN passive, INTEGER securitylevel)
This function will try to login to an ftp server
- INTEGER FUNCTION CreateFTPConnectionOnSocket(INTEGER connectionid, STRING username, STRING passwd, BOOLEAN passive, INTEGER timeout, INTEGER securitylevel)
- BOOLEAN FUNCTION CreateFTPDirectory(INTEGER connectionid, STRING dirname)
This function will create a new directory
- BOOLEAN FUNCTION DeleteFTPDirectory(INTEGER connectionid, STRING dirname, BOOLEAN recursive)
This function will delete a directory. When the directory is not recursively deleted, it should be empty.
- BOOLEAN FUNCTION DeleteFTPFile(INTEGER connectionid, STRING filename)
This function will delete a file
- MACRO DestroyFTPConnection(INTEGER connectionid)
Destroy the connection to the ftp server
- BOOLEAN FUNCTION FTPResultSuccessfull(INTEGER code)
- STRING FUNCTION GetCurrentFTPDirectory(INTEGER connectionid)
This function will change the working directory on the ftp server
- RECORD FUNCTION GetFTPError(INTEGER connectionid)
This function will check and clear the last error that occured (if any)
- RECORD FUNCTION GetFTPFile(INTEGER connectionid, STRING filename)
This function will retrieve a file from the ftp site
- OBJECT FUNCTION MakeSFTPConnection(STRING server, STRING username, STRING password, RECORD options)
- OBJECT FUNCTION MakeSmbConnection(STRING server, STRING username, STRING password, RECORD options)
Connects to a SMB service
- RECORD ARRAY FUNCTION ReadFTPDirectory(INTEGER connectionid)
This function will return a record array of the directory listing
- BOOLEAN FUNCTION RenameFTPFile(INTEGER connectionid, STRING oldpathname, STRING newpathname)
This function will rename a file
- OBJECTTYPE SmbConnection
SMB connection object
- BOOLEAN FUNCTION StoreFTPFile(INTEGER connectionid, STRING filename, BLOB filedata)
This function will store a file to the ftp server
Web Distributed Authoring and Versioning (WEBDAV)
JSON Web Tokens (JWT)
- STRING FUNCTION GetPEMPublicKeyFromJWK(RECORD jwk)
Extract the public key from a JSON Web Key (JWK)
- OBJECT FUNCTION VerifyJSONWebToken(STRING authvalue, RECORD options)
Verify a JWT token