Skip to content

Client Configuration

Warning

The client configuration discussed in this section is applicable only to the licensed self-hosted version of SocketXP Gateway. For the cloud-hosted version of our gateway, please refer to the client configuration section under the Getting Started guide.

SocketXP client, by default, will connect with our cloud gateway server at gateway.socketxp.com. You need to override the default client configuration to make the SocketXP agent/client to connect to your self-hosted gateway server instance.

Device Registration

First download and install the SocketXP client in your IoT devices as shown in the Getting Started guide.

You can then register your IoT devices with the socketxp-gtwy server by using the authtokens generated by your server.

Use the socketxp login command to register your device with your gateway server.

sudo socketxp login <auth-token> --gateway-domain gateway.socketxp.example.com --gateway-port 9443

Warning

Please ensure you use the "--gateway-domain" flag while executing any socketxp command. If you fail to do so, the SocketXP agent will connect to our cloud gateway in the US region by default. The default value of the "--gateway-port" flag is 9443. So you could skip specifying it in the command. It was simply used in the above example to show its usage.

Connecting Local Services with the Gateway

After you register your device with the server, you can then create secure SSL/TLS connections(tunnels) from your local service to the gateway server using the socketxp connect command as shown below:

sudo socketxp connect tcp://127.0.0.1:22 --gateway-domain gateway.socketxp.example.com --gateway-port 9443

Warning

Please ensure you use the "--gateway-domain" flag while executing any socketxp command. If you fail to do so, the SocketXP agent will connect to our cloud gateway in the US region by default. The default value of the "--gateway-port" flag is 9443. So you could skip specifying it in the command. It was simply used in the above example to show its usage.

Sample Client Configuration File:

You can use a config file to save all the client configuration in a single place.

Create a SocketXP client configuration file named config.json under the folder /etc/socketxp/ in your IoT device.

{
    "gateway_domain": "gateway.socketxp.example.com",
    "gateway_port": 9443,
    "tunnels": [           
        {
            "destination": "tcp://127.0.0.1:22"
        }
    ]
}
Start the socketxp client using the above configuration file.
sudo socketxp --config /etc/socketxp/config.json

Running the SocketXP client in the background

Read the documentation section on Background Process to know more about how to run the SocketXP agent as a daemon(Linux Systemd Service) in the background.

Any Questions?

Please write to [email protected], if you have any questions.