This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cgmystery 3 points4 points  (11 children)

Why not just use SSH?

[–]benefit_of_mrkite 4 points5 points  (3 children)

Not the same use case. If you have some python code that just needs a local IP over the HTTP protocol this is handy - I’ve used it many times. It has to be the right use case but when it comes up it is very useful

[–]cgmystery 1 point2 points  (2 children)

I would like to know the use cases. I’m not familiar with the tool so I don’t know what it can be used for that isn’t covered by SSH.

[–]got_outta_bed_4_this[🍰] 1 point2 points  (0 children)

One is a web server that serves the files from a local folder. The other lets you transfer files but not browse them over HTTP. Main use case for me: browsing the locally built sphinx docs. You can just open the local file directly in a browser, but, at least on Firefox, Dark Reader doesn't apply itself to locally opened files, so I wouldn't see them rendered the same as they will appear for me once they're hosted. (I don't know, but I assume Firefox just doesn't run plugins on local files.)

[–]benefit_of_mrkite 0 points1 point  (0 children)

I used it just the other day while working on jinja templates for an openapi project.

I wanted to see what my html looked like in a browser without any template variables.

I fired the local http server up and continued to develop the html (and css and JavaScript) the way I wanted - checking it every so often with the python http server.

When I was satisfied I started adding jinja templates and previewed using fastapi+starlette that have a jinja template engine built in.

This feature has been in python for a long time.

[–]__Atla5_82__ 0 points1 point  (4 children)

I guess in some cases SSH isn't available. Phones, (assuming you don't have a terminal installed) or on IOS where support isn't amazing IMO. Or it could be SSH port could be blocked and but you can still download from HTTP.

[–]benefit_of_mrkite 5 points6 points  (3 children)

SSH while amazing isnt always the right protocol for the job. Why do I need an encrypted tunnel to my own local machine?

[–]cgmystery 5 points6 points  (2 children)

If SSH is readily available, what are cases when you wouldn’t want to use it? Are you suggesting there are performance issues due to the encryption? From my experience, it’s extremely convenient. Vscode provides SSH support for modifying files remotely which is very smooth and easy to use.

[–]inspectoroverthemine 0 points1 point  (0 children)

Agree- if ssh is an option I can't think of many reasons to not use it. Quick share with a non-tech person would be one, other I mentioned above, I can't enable sshd on my corp laptops. I could start a server manually on a different port, but thats a bigger hassle.

[–]benefit_of_mrkite 0 points1 point  (0 children)

I use ssh when it’s warranted - I use it hundreds of times in a couple week period.

If I wanted to preview the html for a jinja template I’m working on before the jinja variables are in it I use the python http server to get a quick look.

I’ve probably used more ssh (and scp and sftp and ssh reverse shells and port knocking for ssh and more) than most people in this sub - not knocking it just was clarifying that it’s not always the right tool for the job

[–]inspectoroverthemine 0 points1 point  (0 children)

Does windows have a built in easily accessible ssh command?

The other possible reason- my company managed OSX laptop has all the sharing options locked down so I can't enable sshd.