Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A AndroidAsync
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 333
    • Issues 333
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Koushik Dutta
  • AndroidAsync
  • Issues
  • #232
Something went wrong while setting issue due date.
Closed
Open
Issue created 10 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

WebSocket and regexp: cannot access matches

Closed

WebSocket and regexp: cannot access matches

Created by: ey3ball

When adding a websocket using a regexp, it is not possible to conveniently get the matched url and / or capture groups, because the initial "request" object is not fully kept (only headers are provided).

Indeed,

When processing a simple get request we can :

server.get("/info/([a-f0-9-]*)", new HttpServerRequestCallback() {
    @Override
    public void onRequest(AsyncHttpServerRequest request,
                          AsyncHttpServerResponse response) {
        /* Extract requested UUID */
        String uuid = request.getMatcher.group(1);

        /* Process request ... */
    }
}

But using a websocket :

server.websocket("/connect/([a-f0-9-]*)", new AsyncHttpSever.WebSocketRequestCallback() {
    @Override
    public void onConnected(WebSocket webSocket, RequestHeaders requestHeaders) {
        /* request is not available, It is not possible to find the requested UUID here
         * without re-processing requestHeaders manually */
    }
}

Since a websocket is initially an HTTP request after all, maybe a more complete request object should be exposed ?

  1. Oh no!

    You are trying to upload something other than an image. Please upload a .png, .jpg, .jpeg, .gif, .bmp, .tiff or .ico.

    Incoming!

    Drop your designs to start your upload.
Tasks
0
server returned results with length 5, expected length of 9

Linked items
0

Link issues together to show that they're related. Learn more.

Related merge requests

3
  • Added protected API for WebSocket creation
    !238
  • Expose the initial HTTP request in WebSocket API
    !241
  • Expose initial http request to WebSocket handlers
    !242

Activity


  • Administrator mentioned in merge request !238 (merged) 10 years ago

    mentioned in merge request !238 (merged)

  • Koushik Dutta closed 10 years ago

    closed

  • Administrator mentioned in merge request !241 (closed) 10 years ago

    mentioned in merge request !241 (closed)

  • Administrator mentioned in merge request !242 (merged) 10 years ago

    mentioned in merge request !242 (merged)

Please register or sign in to reply
0 Assignees
None
Assign to
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
0
0 participants
Reference:

Menu

Explore Projects Groups Snippets