You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-18 09:51:28 +02:00
81 lines
2.4 KiB
Plaintext
Vendored
81 lines
2.4 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 1
|
|
sidebar_class_name: doc-no-cli
|
|
description: Create connection and other functions to work with TCP in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, TCP]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
import Admonition from '@theme/Admonition';
|
|
|
|
# Create connection
|
|
Creates a TCP connection
|
|
|
|
|
|
|
|
<Tabs>
|
|
<TabItem value="params" label="Parameters" default>
|
|
|
|
`Function CreateConnection(Val Address, Val Tls = "", Val Proxy = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Address | - | String | ✔ | Address and port |
|
|
| Tls | - | Structure Of KeyAndValue | ✖ | TLS settings, if necessary. See GetTlsSettings |
|
|
| Proxy | - | Structure Of KeyAndValue | ✖ | Proxy settings, if required. See GetProxySettings |
|
|
|
|
|
|
<div className="return-value-note">
|
|
<div className="return-value-note__title">Returns</div>
|
|
<div className="return-value-note__value">
|
|
Map Of KeyAndValue, Arbitrary - Returns TCP client object on successful connection or error information
|
|
</div>
|
|
</div>
|
|
|
|
</TabItem>
|
|
<TabItem value="extended" label={<span>Advanced call{' '}<a href="/docs/Start/Advanced-call" target="_blank" rel="noreferrer" title="About advanced call" onClick={(e) => e.stopPropagation()}>?</a></span>}>
|
|
|
|
| Parameter | Description |
|
|
|---|---|
|
|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
|
|
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
<Admonition type="caution" title="Caution" className="nocli-admonition">
|
|
<div className="addin">
|
|
<strong>NOCLI:</strong> this method is not available in CLI version
|
|
</div>
|
|
</Admonition>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Address = "45.79.112.203:4242";
|
|
Connection = OPI_TCP.CreateConnection(Address);
|
|
|
|
OPI_TCP.CloseConnection(Connection);
|
|
|
|
Address = "tcpbin.com:4243";
|
|
Tls = OPI_TCP.GetTLSSettings(True);
|
|
|
|
ProxtUser = "proxyuser";
|
|
ProxyPassword = "12we...";
|
|
ProxyAddress = "127.0.0.1";
|
|
ProxyPort = "1080";
|
|
|
|
Proxy = OPI_TCP.GetProxySettings(ProxyAddress, ProxyPort, "socks5", ProxtUser, ProxyPassword);
|
|
Tls = OPI_TCP.GetTLSSettings(True);
|
|
|
|
Connection = OPI_TCP.CreateConnection(Address, TLS, Proxy);
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
|
"AddIn.OPI_TCPClient.Main"
|
|
```
|