lipp / lipp/lua-websockets

No way to pass Origin in sync client

Open
#95 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
419
Forks
117
PR merge metrics
No merged PRs in 30d

Description

I see there are some provisions for Origin header in https://github.com/lipp/lua-websockets/blob/master/src/websocket/handshake.lua#L54

However i could not find a way to supply origin for sync connect()? client_ev.lua does it because it has ws at hand https://github.com/lipp/lua-websockets/blob/61cca37c9257ce68df6cc94300d5a191a365687d/src/websocket/client_ev.lua#L144 - but how am i supposed to do that for sync.lua?

I 'hacked' my way by adding extra argument to connect() and then extending the table
https://github.com/lipp/lua-websockets/blob/master/src/websocket/sync.lua#L149

But not at all sure that's the way - isn't there something more elegant?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare Origin handling in src/websocket/handshake.lua and src/websocket/client_ev.lua, then inspect the sync connect path around src/websocket/sync.lua line 149. Determine how the sync client should accept and forward an Origin value without relying on a workaround. Done means sync connect() provides a supported way to supply Origin consistently with the event client.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
networking
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.