# Can we establish tcp socket connection to remote host from ignition client?

**URL:** <https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844>\
**Category:** Ignition\
**Created:** [February 8, 2022, 4:03am UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844 "2022-02-08T04:03:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [February 8, 2022, 4:03am UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/1 "2022-02-08T04:03:19Z")

</div>

In this case, our Ignition client is running on different host machine from Ignition tag server.  
Is it possible we establish tcp socket connection to another remote host from ignition client machine?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 8, 2022, 12:50pm UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/2 "2022-02-08T12:50:31Z")

</div>

In Vision, yes, with scripting. A bit complicated to manage a background thread’s life cycle, unfortunately.

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [February 8, 2022, 1:20pm UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/3 "2022-02-08T13:20:43Z")

</div>

How can we use scripting in vision client to do this? Do u mind sharing me a sample?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 8, 2022, 5:46pm UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/4 "2022-02-08T17:46:54Z")

</div>

Oh, some combination of these two topics:

> [@Communicating with external applications over TCP/IP socket /websockets using gateway scripts](https://forum.inductiveautomation.com/t/communicating-with-external-applications-over-tcp-ip-socket-websockets-using-gateway-scripts/20455):
>
> How can we communicate Ignition with external applications over TCP/IP sockets or websockets using gateway Jython scripts,? Does the gateway scripts have libraries for TCP sockets or websockets communication? I don't see it in python gateway script library documentation. Has anyone developed a module for it (either commercial or free module). The existing TCP/IP module in Ignition is specifically designed for bar code reader which is not generic in nature. Can JAVA/Jython combination be used so…

> [@TCP/IP Client Service](https://forum.inductiveautomation.com/t/tcp-ip-client-service/55118):
>
> Hi all, I have a machine which provides a TCP/IP server that upon each client connection, sends a large set of segments that reflect a complete copy of the current state of the system (initial download) before streaming each event that occurs from there. If I open up a cmd and enter: Telnet \<IP address\> \<Port\>[ENTER] it behaves as described above. I then tried something like this on button press within a vision client: from telnetlib import Telnet HOST = \<IP address\> PORT = \<Port\> tn = Telne…

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [February 11, 2022, 3:07am UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/5 "2022-02-11T03:07:29Z")

</div>

These are scripts running from gateway. Can we run the scripts / establish the connection from the client PC instead?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 11, 2022, 1:15pm UTC](https://forum.inductiveautomation.com/t/can-we-establish-tcp-socket-connection-to-remote-host-from-ignition-client/55844/6 "2022-02-11T13:15:36Z")

</div>

Yes, same approach.
