Git Product home page Git Product logo

Comments (6)

FZambia avatar FZambia commented on June 27, 2024 1

Glad you solved it, thanks for kind words 👍

from pycent.

FZambia avatar FZambia commented on June 27, 2024

I believe that the reason not in Centrifugo itself but in your setup configuration. Though I can't say exactly where the problem comes from without the possibility to investigate this. This looks like missing network connectivity. Try to reduce problem scope. If you are familiar with tcpdump – it can give you insights.

from pycent.

pythoneast avatar pythoneast commented on June 27, 2024

Thank you @FZambia for your help.
I'll keep trying to resolve the problem. I suspect that the problem in my web server configurations.

from pycent.

FZambia avatar FZambia commented on June 27, 2024

Welcome, maybe also try to use curl or similar when making publish request (since this library uses requests internally so it's not unexpected you got the same error when using requests manually).

curl --header "Content-Type: application/json" \
  --header "Authorization: apikey <YOUR_API_KEY>" \
  --request POST \
  --data '{"method": "publish", "params": {"channel": "channel", "data": {"value": "test"}}}' \
  http://localhost:8000/api

from pycent.

pythoneast avatar pythoneast commented on June 27, 2024

I've connected to my external server via ssh and tested sending request to publish a notification in terminal. I could send a request for publishing a notification via curl successfully.

The problem occurs when I enter a Docker container for Django backend inside my external server. Neither Cent library nor Requests package could send a request for publishing a notification. As I understood the problem is in Docker Network.

from pycent.

pythoneast avatar pythoneast commented on June 27, 2024

@FZambia I solved my problem. The reason was that docker did not send the request directly to https://my-domain/centrifugo/api, since this is the host of the server itself. I solved the problem by creating a separate network in docker and setting static ips for containers. After that, I simply sent requests for publication using the static ip of the container with Centrifugo.
I apologize for disturbing you. The problem was not with Centrifugo itself, but with the Docker settings.
Thanks for your help and a great open source product like Centrifugo.

from pycent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.