> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# TCP Proxy

> Establish a WebSocket tunnel to a port inside the sprite environment.



## AsyncAPI

````yaml sprites/api/asyncapi.json proxy
id: proxy
title: TCP Proxy
description: Establish a WebSocket tunnel to a port inside the sprite environment.
servers:
  - id: production
    protocol: wss
    host: api.sprites.dev
    bindings: []
    variables: []
address: /v1/sprites/{name}/proxy
parameters:
  - id: name
    jsonSchema:
      type: string
      description: Sprite name within the organization.
    description: Sprite name within the organization.
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_2
    id: proxyReceive
    title: 'TCP Proxy: messages from client'
    description: Messages the Sprites API receives from the client.
    type: receive
    messages:
      - &ref_4
        id: ProxyInitMessage
        contentType: application/json
        payload:
          - name: ProxyInitMessage
            type: object
            properties:
              - name: host
                type: string
                description: Target hostname (typically "localhost")
                required: true
              - name: port
                type: integer
                description: Target port (1-65535)
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            host:
              type: string
              description: Target hostname (typically "localhost")
              x-parser-schema-id: <anonymous-schema-27>
            port:
              type: integer
              description: Target port (1-65535)
              x-parser-schema-id: <anonymous-schema-28>
          required:
            - host
            - port
          examples:
            - host: localhost
              port: 5432
          x-parser-schema-id: ProxyInitMessage
        title: Proxy init message
        example: |-
          {
            "host": "localhost",
            "port": 5432
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: ProxyInitMessage
      - &ref_5
        id: proxyRawTcpData
        contentType: application/octet-stream
        payload:
          - type: string
            format: binary
            description: Raw TCP data forwarded without framing
            x-parser-schema-id: <anonymous-schema-29>
            name: Raw TCP data forwarded without framing ((none))
        headers: []
        jsonPayloadSchema: &ref_0
          type: string
          format: binary
          description: Raw TCP data forwarded without framing
          x-parser-schema-id: <anonymous-schema-29>
        title: Raw TCP data forwarded without framing ((none))
        description: Raw TCP data forwarded without framing
        example: >-
          "After init message, raw bytes flow directly: 0x47 0x45 0x54 0x20 0x2f
          ... (HTTP request 'GET /')"
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: proxyRawTcpData
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: proxy
  - &ref_3
    id: proxySend
    title: 'TCP Proxy: messages to client'
    description: Messages the Sprites API sends to the client.
    type: send
    messages:
      - &ref_6
        id: proxyRawTcpData
        contentType: application/octet-stream
        payload:
          - type: string
            format: binary
            description: Raw TCP data forwarded without framing
            x-parser-schema-id: <anonymous-schema-29>
            name: Raw TCP data forwarded without framing ((none))
        headers: []
        jsonPayloadSchema: *ref_0
        title: Raw TCP data forwarded without framing ((none))
        description: Raw TCP data forwarded without framing
        example: >-
          "After init message, raw bytes flow directly: 0x47 0x45 0x54 0x20 0x2f
          ... (HTTP request 'GET /')"
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: proxyRawTcpData
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
  - *ref_5
receiveMessages:
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: proxy
securitySchemes:
  - id: bearerAuth
    name: bearerAuth
    type: http
    description: >-
      Sprites API token in the form `<org>/<id>/<secret>`, sent as
      `Authorization: Bearer <token>` on the upgrade request.
    scheme: bearer
    extensions: []

````