Skip to content

Does itty support WebSockets on CF Durable Objects? #31

Description

@benallfree

I can't seem to get things working, I just get {"status":500,"error":"Invalid URL: [object Request]"}

import { AutoRouter } from 'itty-router'

const router = AutoRouter()

// Handle Socket.IO connections
router.all('/socket.io', async (request, env, ctx) => {
  const id = env.CRAZ.idFromName('craz')
  const stub = env.CRAZ.get(id)

  return stub.fetch(request) // this fails
})

export default router

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions