Skip to content
Railgun
Visit Railgun on GitHub
Set theme to dark (⇧+D)

Enable and disable connections

After a Railgun has been activated, it can be assigned to a particular domain with the conn_set API call. conn_setmode_enabled and conn_setmode_disabled can be used to toggle Railgun on or off for the domain. conn_set also accepts a mode parameter to assign and enable Railgun in a single API call. zone_conn_get_active can be used to view active Railgun connections.

POST conn_set

POST /api/v2/railgun/conn_set

Establish a connection between a domain and a Railgun.

Form parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
  • mode – Railgun operation mode, 1 for active 0 for inactive
Example request
POST /api/v2/railgun/conn_set HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example form parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5pprtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lmode=0z=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_set",         "railgun_id": "1"     },     "result": "success"}

GET conn_set

GET /api/v2/railgun/conn_set

Establish a connection between a domain and a Railgun.

Query parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
  • mode – Railgun operation mode, 1 for active 0 for inactive
Example request
GET /api/v2/railgun/conn_set?email=&tkn=&rtkn=&z=&mode= HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example query string parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5pprtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lmode=0z=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_set",         "railgun_id": "1"     },     "result": "success"}

POST conn_setmode_enabled

POST /api/v2/railgun/conn_setmode_enabled

Enable a Railgun. If request is successful, the specified Railgun will be enabled and traffic for the specified domain will be proxied through Railgun.

Form parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
POST /api/v2/railgun/conn_setmode_enabled HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example form parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5pprtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_setmode_enabled",         "railgun_id": "1"     },     "result": "success"}

GET conn_setmode_enabled

GET /api/v2/railgun/conn_setmode_enabled

Enable a Railgun. If request is successful, the specified Railgun will be enabled and traffic for the specified domain will be proxied through Railgun.

Query parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
GET /api/v2/railgun/conn_setmode_enabled?email=&tkn=&rtkn=&z= HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example query string parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5pprtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_setmode_enabled",         "railgun_id": "1"     },     "result": "success"}

POST conn_setmode_disabled

POST /api/v2/railgun/conn_setmode_disabled

Disable a Railgun. If request is successful, the specified Railgun will be disabled and traffic for the specified domain will no longer use Railgun.

Form parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
POST /api/v2/railgun/conn_setmode_disabled HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example form parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5prtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_setmode_disabled",         "railgun_id": "1"     },     "result": "success"}

GET conn_setmode_disabled

GET /api/v2/railgun/conn_setmode_disabled

Disable a Railgun. If request is successful, the specified Railgun will be disabled and traffic for the specified domain will no longer use Railgun.

Query parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
GET /api/v2/railgun/conn_setmode_disabled?email=&tkn=&rtkn=&z= HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example query string parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5prtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_setmode_disabled",         "railgun_id": "1"     },     "result": "success"}

POST conn_delete

POST /api/v2/railgun/conn_delete

Remove a connection between a domain and a Railgun. This API call will allow a connected Railgun to be assigned to a different domain. Removing the connection of an enabled Railgun and domain will disable Railgun for the domain until a new connection is made with conn_set.

Form parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
POST /api/v2/railgun/conn_delete HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example form parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5prtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_delete",         "railgun_id": "1"     },     "result": "success"}

GET conn_delete

GET /api/v2/railgun/conn_delete

Remove a connection between a domain and a Railgun. This API call will allow a connected Railgun to be assigned to a different domain. Removing the connection of an enabled Railgun and domain will disable Railgun for the domain until a new connection is made with conn_set.

Query parameters

  • email – User account email
  • tkn – User API token
  • z – Domain name
  • rtkn – Railgun token
Example request
GET /api/v2/railgun/conn_delete?email=&tkn=&rtkn=&z= HTTP/1.1Host: www.cloudflare.comAccept: */*Content-Type: application/x-www-form-urlencoded
Example query string parameters:
email=user%40cloudflare.comtkn=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5prtkn=7h8i9j0k1l2m3n4o5p6q7r8id9h0j1lz=example.com
Example response
HTTP/1.1 200 OKContent-Type: application/json
{     "msg": null,     "response": {         "act": "railgun_conn_delete",         "railgun_id": "1"     },     "result": "success"}