d11wtq / dockerpty

Pseudo-tty handler for docker Python client
https://github.com/d11wtq/dockerpty
Apache License 2.0
156 stars 62 forks source link

I want to integrate the 'dockerpty' inside of web app. #65

Open lioncui opened 8 years ago

lioncui commented 8 years ago

I hope pass through the web access container tty, which part of the code i need to care about it ? Or there is any open source project to reference ?

disheng5 commented 8 years ago

i want know too

TomasTomecek commented 8 years ago

It shouldn't be that hard. All you need to do is to pipe streams correctly: input from the webapp to stdin of container and stdout/err output from container to webapp. It will be pretty tricky to interpret terminal escape sequences correctly. There could be a lib for that.

By piping streams I mean: https://github.com/d11wtq/dockerpty/blob/master/dockerpty/__init__.py#L20 in your case, these streams will likely be some buffers filled by thread within your webapp where the thread will receive input from client's browser via websockets.

My $ .02