Zend certified PHP/Magento developer

How to connect magento2 to Elasticsearch in different server

I have done setup magento 2.4.2 in cloud/shared hosting, and then i have Elasticsearch in VPS with config .yml like this :

transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
node.name: elasticsearch-node-1
cluster.initial_master_nodes: [“elasticsearch-node-1”]

How to connect this elastic from shared/cloud hosting?