how to establish locally hosted Docker API server with SocketXP forwarding Webhooks

  docker, tcp, tunnel, webhooks

I have a locally running SQL server in a docker container. I have set up the following socketXP container using the attached config file. when I ping the socketXP route nothing happens? am I missing something here? I have also attached the console which shows which ports are being listened on. I think the port assignments in my setup may be incorrect. I have attached config file and images of the server console and teh socketXP dash for reference

docker commands in setting up (Powershell):

Set up your socketXP connection

input:

docker pull expresssocket/socketxp

output:

Using default tag: latest latest: Pulling from expresssocket/socketxp Digest: sha256:0f8755d521f80dca596228d6145e84828b6983eaee370f3f714deac41a0ce7b6 Status: Image is up to date for expresssocket/socketxp:latest

Create a config.json file in your local directory and map it as a volume inside the container at /data directory as shown in the example below.

Config.json FILE EXAMPLE BELOW:

{
    "authtoken": "Emitted",
    "tunnel_enabled": true,
    "tunnels" : [{
        "destination": "http://172.17.0.2:1433",
        "protocol": "http",
        "custom_domain": ""
    }],
    "relay_enabled": true,
    "relays": [{
    "destination": "http://localhost:5002"
    }]
}

Create the socketXP container

input:

docker run --name SocketXPWebHookRelay --restart unless-stopped -d  -v C:DockerConfigsSocketXp:/data expresssocket/socketxp:latest

Outputs the new container docker tag assigned to your container ^^^

output:

fcbf34f361ff2f2a571e474f75a0691e070453b2b8d321adc3f4ecbe8271f652

Login to your socketXP account with the container in docker

input:

docker logs fc

output:

Error: "socketxp login" requires at least 1 argument. See 'socketxp login --help'. Usage:  socketxp login [token] [flags] Login to the SocketXP service.  Obtain an auth token from https://portal.socketxp.com Using config file: /data/config.json Login Succeeded. User [Mitchell Storrie] Email [Emitted]. Connected. Public URL -> Emitted Connected. Public URL -> Emitted

Everything up to here seems to run fine. the public URL is now showing on my socketXP dash. the reroute is showing correctly also which you can see in the image below.

SocketXP Dash

Yet when I pass webhooks or API commands to the server they don’t seem to be getting through. the image below shows the console of the server running after startup. NOTE that the listening port in the console is different to that assigned by docker. I believe this may be the issue but not sure why. Will test and relay any progress.

SQL Server Console Image

Thankyou for your time and I hope this helps others facing similar issues or just getting started.

References:

https://www.linkedin.com/pulse/how-receive-stripe-webhooks-your-localhost-testing-ganesan-velrajan#:~:text=Testing%20Stripe%20webhooks%20locally%20on,URL%20for%20your%20localhost%20app

https://docs.docker.com/engine/swarm/configs/

https://dev.to/gvelrajan/develop-and-test-your-microservices-locally-without-toasting-your-laptop-10aa

https://www.socketxp.com/docs/guide/installation.html#arm64-aarch64-arm64-v8

https://www.socketxp.com/docs/guide/installation.html#docker-container

https://www.socketxp.com/download

Source: Docker Questions

LEAVE A COMMENT