Skip to main content

Hotsock v1.0 Released!

ยท 4 min read

Real-time functionality is a core expectation in modern applications. Whether you're building complex user interfaces, showing messages and typing indicators for a chat product, keeping player moves up-to-date in a collaborative game, or one of endless other multi-player use cases, instant feedback is crucial for a great user experience.

Implementing real-time features often requires integrating with a third-party service and dealing with fixed limits, difficult sales processes, and questionable or unstable SDKs. Plus, you're sending private data out of your systems to external providers that are potentially thousands of miles from you and your customers' geographic locations. And who knows, they might also be using your data to train their latest AI model. ๐Ÿ™„

Starting today, you can install a full-featured, real-time WebSockets service securely and privately in your own AWS account in any of the 22 supported commercial AWS regions around the world, with more regions to come in the future.

What's in the boxโ€‹

It includes these features and so much more โ€”

With support for regions across the globe, your customers can connect with the low latency they're accustomed to and your business can meet any data residency and compliance requirements.

Hotsock provides powerful, intuitive, and stable APIs for building real-time applications while standing on the shoulders of a giant โ€” AWS.

Publish real-time messagesโ€‹

Use the AWS SDK you're already familiar with to publish messages via AWS Lambda โ€” in any supported language. Here's a Python example, but you can easily do the same with Go, Ruby, Java, JavaScript, Node.js, .NET, PHP, Rust, C++, the AWS CLI, and more.

lambda_client.invoke(
FunctionName='Hotsock-PublishFunction-AAABBBCCCDDD',
Payload=json.dumps({
'channel': 'my-channel',
'event': 'my-event',
'data': '๐Ÿ‘‹'
})
)

You can also publish via good ol' HTTP if that's your preference.

Subscribe your clientsโ€‹

For browser-based clients, you can get up and running quickly with Hotsock JS.

// Call the handleMessage function when "my-event" events are
// received on the "my-channel" channel.
const channel = hotsock.channels("my-channel")
channel.bind("my-event", handleMessage)

function handleMessage(messageObj) {
console.log("Received", messageObj)
}

// Received Object {
// id: "01HP8BGSHWY952BXW1PE25DSJA",
// event: "my-event",
// channel: "my-channel",
// data: "๐Ÿ‘‹"
// }

For mobile applications, consider using URLSessionWebSocketTask on iOS/macOS and javax.websocket (Java) or WebSocket from stdlib (Kotlin) on Android. Hotsock JS also supports React Native. Official Hotsock client SDKs for iOS/macOS and Android are on the roadmap for the future.

Combining the best of fully-managed with self-hostedโ€‹

  • If it's fully-managed, isn't the data accessible by another provider? Nope!
  • If I have to self-host it, don't I have to allocate time to manage it? Nope!

Each installation is backed exclusively by fully-managed AWS services that go to great lengths to keep you data private and encrypted. These services include API Gateway WebSockets, Lambda, DynamoDB, Simple Queue Service (SQS), EventBridge, Simple Notification Service (SNS), and CloudFormation.

There are no servers or containers to manage and no scaling knobs to turn. AWS billing is completely usage-based, so there's no infrastructure cost if the stack is idle and Hotsock will automatically scale to handle production workloads with millions of connections and billions of messages.

Installation requires just two AWS CLI commands, doesn't require a sign up, is fully automated with CloudFormation (infrastructure-as-code), and takes less than 20 minutes. Updates to Hotsock are fully automated, further reducing any ongoing management burden to your staff.

Helper tools and librariesโ€‹

Alongside this launch, there are a few other tools and libraries that are now available โ€”

  • jwt-issuer: A CloudFormation stack that allows you to use AWS Lambda to issue JWTs backed by a key securely stored in AWS Key Management Service (KMS) or Parameter Store.
  • hotsock-js: A client JS library for WebSocket connections, channel subscriptions, and sending/receiving messages.
  • hotsock-ruby: A server library for publishing messages and signing Hotsock JWTs from your Ruby/Rails application.
  • installer-permissions: The CloudFormation template containing the IAM roles and policies needed when creating a Hotsock installation.

Licensingโ€‹

The Free Tier includes 1 million WebSocket messages per month โ€” forever. Upgrade your installation to the Paid Tier for production applications needing more messages, multiple AWS accounts and regions, and dedicated support.

Give it a try today!