Forums

Does pythonanywhere support websockets

I would like to deploy a flask socket IO web app but i saw a post from 2 years ago saying Pythonanywhere does not support web sockets

That is still true

It has been 2 years from now! I know it's not easy to have, I know it needs a lot of work, but you are losing a lot of users due to it actually. Are there any plans to support WebSocket? If yes when can I expect that?

It should happen at some point. We can't give you any dates.

is it still true ? ;_;

Still true, unfortunately.

do you support websockets now?

No

dang it

¯\_(ツ)_/¯

Guess we'll have to go somewhere else... too bad. I liked pythonanhywhere. :-/

you can also use pythonanywhere along with a third party service like pusher to get web sockets.

Alright, I'm interested. Care to tell me more?

Check out something like https://pusher.com/websockets

Hi guys! Any news on websockets?

Is it currently on your plans? If yes, do you have an ETA?

Thank you

No, there is not news.

Just adding my $0.02 wish for web sockets support.

Thanks! Noted.

Is it supported now ?

Not yet

My next project will be heavily geared towards Socket IO. Is there any timeline yet? I imagine I will have this project up and running within the year. TIA.

No timeline yet.

any updates? is it supported now? it's a request to integrate it soon. TIA

Not yet.

With Anaconda, is it possible to provide websocket support ASAP? I have been using pythonanywhere for many years, really like it. But I have to add two-way messaging using websocket, really don't want to switch to other vendors.

While there's a bit of corporate integration work ongoing, ASGI support is top of our list for things to add after the next system update. That system update is going through the final tests at the moment before we release it, so we'll be moving on to ASGI soon :-)

any updates?

not yet

[deleted]

Still working on it, unfortunately :-(

Could you give a date when the use of websockets could be possible?

We don't have ETA, but we will notify you when it's done.

so sad

boo

Thanks, noted.

What's the update now?

There is no update

Let's get websockets working!

We're working on it

So... this is not available yet?

Not yet

Can anyone tell an alternative where to use it?

? why???

:/

It's on the way.

is it still true ? ;-;

Still working on it :-)

One day this thread will be a much more satisfying read... until then I will wait patiently

Indeed it will :-)

I have a free plan but does web sockets atleast work on paid plans???

No, they do not

Hi, you said it's on the way back in July of this year. Do you have an ETA?

No

Good luck working on it ;)

Thanks

is it here yet? ಥ_ಥ

No, not yet

No worries

PS: Anyone else who is struggling with this; use the pusher API (https://pusher.com/) I had to refactor from using Socket IO since even other platforms like Vercel don't support sockets.

Its easy to setup and seems to work fine with PA. check this video for integration with flask: https://www.youtube.com/watch?v=h4kIkPxhXPs

Best of luck

still true? ;(

We're in a phase of testing support for ASGI web apps, which will also enable support for web sockets. If anyone is interested in participating in the testing program (API only, limited features), please let us know at support@pythonanywhere.com.

I don't know much about the subject, but can a page made with Flask support ASGI?

Flask officially supports ASGI as of v2.0. Though it's not supported on PythonAnywhere right now.

https://flask.palletsprojects.com/en/2.0.x/deploying/asgi/

Ok, I'll be waiting for when they add it to Flask. Thanks!

This is unacceptable and border on false advertisement claiming that you can run python web applications yet not making it clear that socketio is not supported. I spent a whole lot of time making my web app work here making changes to support WSGI as well as keep upgrading my plan to support my work just to find out that in the last stretch i get this error

raise RuntimeError('Cannot obtain socket from WSGI environment.')

Sorry for the confusion! In fact, this information is mentioned on the front page of our help pages, see:

And here's some very brief FAQ answers about common requests: ... Can I use websockets, or run my own socket server? I'm afraid not -- we only support Python apps that implement the WSGI protocol

We're open to suggestions how we could make it clearer!

PS. We are working in adding full support to ASGI apps and web socket apps, we already have the infrastructure, but it's being tested now. If you want, you can try it, by using our API and adjusting the existing docs to your use case, see:

Here is a suggestion:

under the "Web" menu, before a client clicks "Add a new web app", warn them that you dont support adding web apps that require web sockets e.g. Flask-SocketIO etc.

Also

On the pricing page, under the section that shows how many web apps can be created for each pricing tier, put a caveat there that web socket apps are not supported

Thanks for the suggestions.

Still nothing on SocketIO? So basically you guys haven't done #### for over 4 years. You guys say your working on it but clearly not.

Nothing right now but we are working on it

[formatted by admin]

ERROR: virtualenvwrapper could not find virtualenv in your path
08:00 ~ $ pip install virtualenvwrapper
bash: pip: command not found
08:03 ~ $ sudo apt install virtualenvwrapper
bash: sudo: command not found
08:03 ~ $

any help

Did you change something in your ~/.bashrc file or changed the PATH environment variable in your console? Also, you will not be able to use sudo on PythonAnywhere; if you need you can try this to install virtualenvwrapper.

please just activae sockets for chat webapps, i promise you that's what 90% of users want to use it for

Thanks for the suggestion. We are working on it.

Please activae sockets.

Active sockets, is very important.

Thanks for the suggestion. We are working on it.

Would be nice with some socks !

Which framework would you be using for them? We have limited experimental support for some ASGI frameworks at the moment.

Hey, on the risk of sounding redundant any news on web sockets?

No news.