Skip to content

fix: support tcp binding ip:port or ip of ipv4 or ipv6 #2381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oyaya
Copy link

@oyaya oyaya commented Dec 2, 2024

bugfix: make it possible to bind ip:port or ip from support only binding ip.

@chensunny
Copy link

chensunny commented Apr 18, 2025

  1. Which cases will use the ip: port ,It looks very strange.
  2. It may cause a Breaking Change in some cases

Because, as a TCP client, the port will be assigned by the Linux kernel;

@oyaya

@@ -3430,7 +3430,7 @@ ngx_http_lua_socket_tcp_handler(ngx_event_t *ev)
static ngx_int_t
ngx_http_lua_socket_tcp_get_peer(ngx_peer_connection_t *pc, void *data)
{
/* empty */
pc->type = SOCK_STREAM;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

mergify bot commented Apr 18, 2025

This pull request is now in conflict :(

@mergify mergify bot added the conflict label Apr 18, 2025

len -= plen + 1;

addr = ngx_http_lua_parse_addr(L, text, len);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated parsing of addr from above

@chensunny
Copy link

chensunny commented Apr 18, 2025

Just have a discussion:
Maybe sock:bind(ip,port) is better for Breaking Change?

@zhuizhuhaomeng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants