Project

General

Profile

Sockopen » History » Version 13

Per Amundsen, 05/21/2021 06:48 AM

1 1 Per Amundsen
_Added in 1.8.10_
2
3 12 Per Amundsen
*/sockopen [-dentI46C] [bindip] <name> <address/hostname> <port> [certificate]*
4 1 Per Amundsen
5 7 Per Amundsen
Opens a socket connection to the specified ipaddress/hostname and port.
6
7 1 Per Amundsen
*Switches*
8
9
-d - The specified IP address is the bind ip address.
10
-e - Creates an SSL connection.
11 3 Per Amundsen
-n - Disables the "Nagle algorithm":https://en.wikipedia.org/wiki/Nagle%27s_algorithm.
12 1 Per Amundsen
-t - *TODO*
13 9 Per Amundsen
-I - Accept invalid remote SSL/TLS certificates. *(AdiIRC only)*
14 2 Per Amundsen
-4 - Connect to Ipv4 addresses.
15 1 Per Amundsen
-6 - Connect to Ipv6 addresses.
16 11 Per Amundsen
-C - Indicates that [certificate] is specified. *(AdiIRC only)*
17 1 Per Amundsen
18
*Parameters*
19
20
[bindip] - Bind ip to be used.
21
<name> - Socket connection name.
22 7 Per Amundsen
<address/hostname> - Remote ip address or hostname to connect to.
23 1 Per Amundsen
<port> - Remote port to connect to.
24 10 Per Amundsen
[certificate] - the SSL certificate "pfx":https://en.wikipedia.org/wiki/PKCS_12 file to use with -C, if not specified, the global client certificate is used. *(AdiIRC only)*
25 1 Per Amundsen
26
*Example*
27
28
<pre>
29
alias example {
30 13 Per Amundsen
  ; Initiate a connection with "irc.libera.chat" on port 6669, Secured connection.
31
  /sockopen -e IRC irc.libera.chat +6697
32 1 Per Amundsen
}
33
 
34
on *:sockopen:IRC:{
35 6 Per Amundsen
  ; Send our USER and NICK irc commands.
36 1 Per Amundsen
  /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf
37
  /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf
38
}
39
 
40 6 Per Amundsen
; Show all receiving data in a window.
41 1 Per Amundsen
on *:sockread:IRC:{
42
  /window -de @IRC
43
  /var %x
44
  /sockread %x
45
  /aline -p @IRC $iif(%x,$v1,-)
46
}
47
</pre>