Project

General

Profile

Sockopen » History » Version 16

Per Amundsen, 02/16/2023 03:22 PM

1 1 Per Amundsen
_Added in 1.8.10_
2
3 15 Per Amundsen
*/sockopen [-dentI46Cuswap] [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 16 Per Amundsen
table(ktable).
10
|*Switch*|*Description*|
11
| -d | The specified IP address is the bind ip address. |
12
| -e | Creates an SSL connection. |
13
| -n | Disables the "Nagle algorithm":https://en.wikipedia.org/wiki/Nagle%27s_algorithm. |
14
| -t | *TODO* |
15
| -I | Accept invalid remote SSL/TLS certificates. *(AdiIRC only, deprecated)* |
16
| -4 | Connect to Ipv4 addresses. |
17
| -6 | Connect to Ipv6 addresses. |
18
| -C | Indicates that client [certificate] is specified. *(AdiIRC only)* |
19
| -u | Enables "dual stack sockets":https://docs.microsoft.com/en-us/windows/win32/winsock/dual-stack-sockets. |
20
| -s | Skip invalid remote SSL/TLS certificates certificates. |
21
| -w | Display warning dialog for invalid remote SSL/TLS certificates. |
22
| -a | Accept invalid remote SSL/TLS certificates. |
23
| -p | Prevent remote SSL/TLS certificate caching. |
24 15 Per Amundsen
25
*Parameters*
26 1 Per Amundsen
27 16 Per Amundsen
table(ktable).
28
|*Parameter*|*Description*|
29
| [bindip] | Bind ip to be used. |
30
| <name> | Socket connection name. |
31
| <address/hostname> | Remote ip address or hostname to connect to. |
32
| <port> | Remote port to connect to. |
33
| [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)* |
34 1 Per Amundsen
35
*Example*
36
37
<pre>
38
alias example {
39 13 Per Amundsen
  ; Initiate a connection with "irc.libera.chat" on port 6669, Secured connection.
40
  /sockopen -e IRC irc.libera.chat +6697
41 1 Per Amundsen
}
42
 
43
on *:sockopen:IRC:{
44 6 Per Amundsen
  ; Send our USER and NICK irc commands.
45 1 Per Amundsen
  /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf
46
  /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf
47
}
48
 
49 6 Per Amundsen
; Show all receiving data in a window.
50 1 Per Amundsen
on *:sockread:IRC:{
51
  /window -de @IRC
52
  /var %x
53
  /sockread %x
54
  /aline -p @IRC $iif(%x,$v1,-)
55
}
56
</pre>