Hacker Newsnew | past | comments | ask | show | jobs | submit | skimdesk's commentslogin

For a very simple API, warp [1].

[1]: https://github.com/seanmonstar/warp


If you're into horror comedy movies, be sure to check out Rare Exports [1]. It combines some of the folklore with the commercial father christmas.

[1]: https://en.m.wikipedia.org/wiki/Rare_Exports:_A_Christmas_Ta...


Really fun!

I have been experimenting with similar idea myself. I was curious on how you handle instantiating the terminal state for new clients. Seems like you're storing a buffer [0] of past output, and replaying that?

[0] https://github.com/ekzhang/sshx/blob/91c82d46cde4d1ffa0ae34e...


Yep, it’s a rolling 2 MiB buffer in RAM. Also do some snapshotting for persistence / server fault-tolerance, and that size is much smaller.


Does that mean it can avoid having to interpret terminal control codes (ie be a full terminal emulator)? That's a clever way.



Hi HN.

ScaleSocket is a command line tool that lets you to wrap any STDIO capable script or binary, and serve it over websockets. Clients then connect to rooms (channels) which have an unique URL (wss://example.com/exampleroom). Connecting to a room spawns a new process of the wrapped script. Subsequent websocket connections to the same room share the process.

I built ScaleSocket in order to be able to build multiplayer back-ends quickly. In the past, I have been experimenting with websocketd [1] to stream a command line application to the browser. It seemed to me that using that approach, i.e. spawning a process and streaming it over websockets, would make a nifty back-end for browser based multiplayer games. ScaleSocket takes that one step further, by supporting shared backend processes.

It's a pleasant approach to get started with, since no lobby server or netcode is required for making a multiplayer backend. ScaleSocket has been my prototyping tool for multiplayer games for some time now.

[1] https://news.ycombinator.com/item?id=9050970


It's similar to running netcat in server mode, wrapping a script. It's even closer to doing that using websocat [1], whereby one does not have to do the websocket header juggling.

The main difference is that while netcat or websocat will spawn a new process for each connecting client, ScaleSocket has a concept of rooms (channels). For a room, a process is spawned once only. All clients connecting to the same room are routed to the same process. This is not straight forward to do using the forementioned tools.

There's a small comparison page [2] where I have mentioned some alternative tools.

[1] https://github.com/vi/websocat

[2] https://www.scalesocket.org/man/comparison


I've been developing a websocket server that lets multiple users connect to the same command-line app.

I wrote a short example [1] that exposes a TUI game on the web. In theory, hot-seat terminal games should be playable over the web with this.

My current challenge has been around refreshing the screen for late joiners. I need to save some of the ANSI escape history and replay it to clients, or ask the application to redraw itself. If anyone has ideas on how to approach this i'm all ears.

[1] https://www.scalesocket.org/man/examples/terminal


We've used dbmate[1] outside of the Django/alembic ecosystem.

[1] https://github.com/amacneil/dbmate


I was eager to try this. The screenshots had me convinced the workflow would resemble Alfred/Spotlight. Be careful of guessing your users workflows - there are a lot of ways using git. It seems opening the commit window stages all changes. I'm used to working with patches (`-p`), so in in it's current form it wont suit my workflow.


Another useful Google search trick not mentioned in the article is numeric range queries.

You can use two numbers separated by two dots to represent all numbers in the range.

For example, a search for

  taki 100..200
gives me results for taki 183.

This is useful when you can't remember an exact year or number.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: