kandi background
Explore Kits

WAMPlay | Framework | Websocket library

 by   blopker Java Version: Current License: MIT

 by   blopker Java Version: Current License: MIT

Download this library from

kandi X-RAY | WAMPlay Summary

WAMPlay is a Java library typically used in Networking, Websocket, Framework applications. WAMPlay has no vulnerabilities, it has a Permissive License and it has low support. However WAMPlay has 2 bugs and it build file is not available. You can download it from GitHub.
This is a WAMP implementation for the Play! Framework. Use it to add RPC and Pub/Sub websocket functionality to your site!.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • WAMPlay has a low active ecosystem.
  • It has 28 star(s) with 8 fork(s). There are 5 watchers for this library.
  • It had no major release in the last 12 months.
  • WAMPlay has no issues reported. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of WAMPlay is current.
WAMPlay Support
Best in #Websocket
Average in #Websocket
WAMPlay Support
Best in #Websocket
Average in #Websocket

quality kandi Quality

  • WAMPlay has 2 bugs (0 blocker, 0 critical, 2 major, 0 minor) and 64 code smells.
WAMPlay Quality
Best in #Websocket
Average in #Websocket
WAMPlay Quality
Best in #Websocket
Average in #Websocket

securitySecurity

  • WAMPlay has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • WAMPlay code analysis shows 0 unresolved vulnerabilities.
  • There are 9 security hotspots that need review.
WAMPlay Security
Best in #Websocket
Average in #Websocket
WAMPlay Security
Best in #Websocket
Average in #Websocket

license License

  • WAMPlay is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
WAMPlay License
Best in #Websocket
Average in #Websocket
WAMPlay License
Best in #Websocket
Average in #Websocket

buildReuse

  • WAMPlay releases are not available. You will need to build from source code and install.
  • WAMPlay has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • WAMPlay saves you 639 person hours of effort in developing the same functionality from scratch.
  • It has 1484 lines of code, 135 functions and 49 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
WAMPlay Reuse
Best in #Websocket
Average in #Websocket
WAMPlay Reuse
Best in #Websocket
Average in #Websocket
Top functions reviewed by kandi - BETA

kandi has reviewed WAMPlay and discovered the below as its top functions. This is intended to give you an instant insight into WAMPlay implemented functionality, and help decide if they suit your requirements.

  • Connects to WebSocket WebSocket .
    • Publish event .
      • Returns the message handler for the given request .
        • Sends a response .
          • Truncate publish events .
            • Constructs the error information .
              • On subscribe .
                • Get the meaning of the life of the given session ID .
                  • Start RPC server
                    • Returns the result as a List

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      WAMPlay Key Features

                      WAMP implementation for the Play! Framework

                      Build.scala

                      copy iconCopydownload iconDownload
                      "ws.wamplay" %% "wamplay" % "0.1.6"
                      

                      routes

                      copy iconCopydownload iconDownload
                      # Send websocket connections to the WAMPlay server
                      GET     /wamp                     ws.wamplay.controllers.WAMPlayServer.connect()
                      

                      WAMPlayController

                      copy iconCopydownload iconDownload
                      @URIPrefix("http://example.com/sample")
                      public class SampleController extends WAMPlayContoller {
                      
                      	@onRPC("#meaningOfLife")
                      	public static String getMeaningOfLife(String sessionID) {
                      		return "Meaning of life is: 42";
                      	}
                      
                      	@onRPC("#capital")
                      	public static String add(String sessionID, JsonNode[] args) {
                      		String ans = args[0].asText().toUpperCase();
                      		return ans;
                      	}
                      
                      	@onSubscribe("/chat")
                      	public static boolean capitalSubscribe(String sessionID) {
                      		return true;
                      	}
                      
                      	@onPublish("/chat")
                      	public static JsonNode truncatePublish(String sessionID, JsonNode event) {
                      		return Json.toJson(event);
                      	}
                      }
                      

                      Global.java

                      copy iconCopydownload iconDownload
                      public class Global extends GlobalSettings {
                      	@Override
                      	public void onStart(Application app) {
                      		WAMPlayServer.addController(new SampleController());
                      	}
                      }
                      

                      Community Discussions

                      Trending Discussions on Websocket
                      • Not able to connect to websocket using Nginx and Uvicorn
                      • Symfony Doctrine EntityManager not refreshing properly
                      • SignalR CORS issue with Angular and .NET Core
                      • .NET 6.0: new Blazor project throws Websocket error
                      • WebSocket not working when trying to send generated answer by keras
                      • no affect on CORS enabling with NESTJS
                      • How to give certificate to Java Websocket?
                      • Push local WebRTC stream to a NodeJS server in the cloud
                      • Intercept WebSocket messages
                      • How many total TCP connections are created for web socket call from browser to apache http server to web service
                      Trending Discussions on Websocket

                      QUESTION

                      Not able to connect to websocket using Nginx and Uvicorn

                      Asked 2022-Mar-26 at 10:20

                      I built a docker container with Django, Uvicorn, Nginx and Redis, and am using django-channels but when I run this it says it cannot connect to the websocket and this is seen in the browser console:

                      WebSocket connection to 'ws://127.0.0.1:8080/ws/notifications/' failed

                      It is working fine when I use Django's runserver command for development but when I include Nginx and Uvicorn it breaks.

                      Entrypoint.sh:

                      gunicorn roomway.asgi:application --forwarded-allow-ips='*' --bind 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker
                      

                      Nginx config:

                      upstream django {
                          server app:8000;
                      }
                      
                      map $http_upgrade $connection_upgrade {
                          default upgrade;
                          '' close;
                      }
                      
                      server {
                          listen 8080;
                      
                          location /static {
                              alias /vol/static;
                          }
                      
                          location /ws/ {
                              proxy_pass http://0.0.0.0:8000;
                              proxy_http_version 1.1;
                              proxy_set_header Upgrade $http_upgrade;
                              proxy_set_header Connection $connection_upgrade;
                          }
                      
                          location / {
                              proxy_pass http://django;
                              proxy_set_header Host $http_host;
                              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                              proxy_set_header X-Forwarded-Proto $scheme;
                              proxy_set_header Upgrade $http_upgrade;
                              proxy_set_header Connection $connection_upgrade;
                              proxy_redirect off;
                              proxy_buffering off;
                          }
                      }
                      

                      settings.py:

                      CHANNEL_LAYERS={
                          'default': {
                              'BACKEND': 'channels_redis.core.RedisChannelLayer',
                              'CONFIG': {
                                  'hosts': [('redis', 6379)],  #Redis port
                              }
                          }
                      }
                      

                      The JS file which handles the socket:

                      var wsStart = "ws://"    
                      var webSocketEndpoint =  wsStart + window.location.host + '/ws/notifications/'
                      const notificationSocket = new WebSocket(webSocketEndpoint)
                      

                      asgi.py:

                      application = ProtocolTypeRouter({
                          "http": django_asgi_app,
                          "websocket": AuthMiddlewareStack(
                              URLRouter([
                                  url(r'^ws/notifications/', NotificationConsumer.as_asgi()),
                                  path("ws/<str:room_name>/", ChatConsumer.as_asgi())            
                              ])
                          )
                      })
                      

                      Nginx throws this error with the above code:

                      [error] 23#23: *4 connect() failed (111: Connection refused) while connecting to upstream, server: , request: "GET /ws/notifications/ HTTP/1.1", upstream: "http://0.0.0.0:8000/ws/notifications/", host: "127.0.0.1:8080"
                      

                      When I change the proxy_pass to http://django instead of 0.0.0.0, Nginx does not throw that error anymore but I get the same error on the console. Also this time Django throws these warnings:

                      [WARNING] Unsupported upgrade request.       
                      [WARNING] No supported WebSocket library detected. Please use 'pip install uvicorn[standard]', or install 'websockets' or 'wsproto' manually.
                      

                      ANSWER

                      Answered 2022-Mar-26 at 10:20

                      As noted in a comment by Iain Shelvington, it seems like websockets are not included in the base install of uvicorn

                      pip uninstall uvicorn
                      pip install 'uvicorn[standard]'
                      

                      Source https://stackoverflow.com/questions/68828128

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install WAMPlay

                      You can download it from GitHub.
                      You can use WAMPlay like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the WAMPlay component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Websocket Libraries
                      Try Top Libraries by blopker
                      Compare Websocket Libraries with Highest Support
                      Compare Websocket Libraries with Highest Quality
                      Compare Websocket Libraries with Highest Security
                      Compare Websocket Libraries with Permissive License
                      Compare Websocket Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.