René's URL Explorer Experiment


Title: [Socket] Server::listen() is blocking if given a hostname · Issue #181 · reactphp/reactphp · GitHub

Open Graph Title: [Socket] Server::listen() is blocking if given a hostname · Issue #181 · reactphp/reactphp

X Title: [Socket] Server::listen() is blocking if given a hostname · Issue #181 · reactphp/reactphp

Description: Calling Socket\Server::listen($port, $host) with a hostname instead of an IPv4 address is a blocking operation. Example: $server = new Socket\Server($loop); $server->listen(1234, 'example.com'); Giving a hostname will result in resolving...

Open Graph Description: Calling Socket\Server::listen($port, $host) with a hostname instead of an IPv4 address is a blocking operation. Example: $server = new Socket\Server($loop); $server->listen(1234, 'example.com'); Gi...

X Description: Calling Socket\Server::listen($port, $host) with a hostname instead of an IPv4 address is a blocking operation. Example: $server = new Socket\Server($loop); $server->listen(1234, 'example.co...

Opengraph URL: https://github.com/reactphp/reactphp/issues/181

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Socket] Server::listen() is blocking if given a hostname","articleBody":"Calling Socket\\Server::listen($port, $host) with a hostname instead of an IPv4 address is a blocking operation.\n\nExample:\n\n``` php\n$server = new Socket\\Server($loop);\n$server->listen(1234, 'example.com');\n```\n\nGiving a hostname will result in resolving it via DNS (blocking).\n\nPossible solutions include:\n1.  Reject hostnames altogether and only accept IP addresses. Easy temporary solution, but listening on hostnames is a convenient feature, think of listening on `localhost:1234`\n2.  Accept this as a known limitation and block. Not likely that we want to see something like this in an async library though\n3.  Async resolving via React\\Dns component: Requires passing in a Resolver instance somewhere and will have to change the `listen()` method to return a Promise instead. Should be pretty straight forward, but changing the API in such a subtle way is likely going to break existing code\n4.  Create new `Socket\\Factory` class that does all the work, accept an optional Resolver instance to resolve any hostnames before passing it to a `listen()` call.\n\nPersonally, I'd go for suggestion 4 as we have a number of outstanding issues with `Socket\\Server` anyway (UNIX sockets, SSL sockets, no IPv6 support, API consistency, etc.). I've implemented a very similar factory for clue/socket-react [here](https://github.com/clue/socket-react/blob/e7c457e7db8424d468d0dc1fc2ae0bcc31dbe2d6/Socket/React/Stream/Factory.php#L100) and [here](https://github.com/clue/socket-react/blob/e7c457e7db8424d468d0dc1fc2ae0bcc31dbe2d6/Socket/React/Datagram/Factory.php#L65) and for clue/socket-raw [here](https://github.com/clue/socket-raw/blob/f687c65b20fe9984b248d151e2eb68482bb840f5/Socket/Raw/Factory.php#L36). It's been working out quite good (feel free to take a look at each projects' examples) and I'd love to see something similar in react.\n\nIn the future this could possibly also allow merging SocketClient and Socket into a single package as they share quite a bit of code and it could allow us to call\n\n``` php\nFactory::createServer('localhost:1234')->then(function (Server $server) { });\nFactory::createClient('localhost:1234')->then(function (Connection $client) {\n   $client->end('hello');\n});\n```\n\nThis provides a very consistent API, is very similar to how `stream_socket_server()` and `stream_socket_client()` work and could easily be extended to support IPv6, SSL and UNIX domain sockets.\n","author":{"url":"https://github.com/clue","@type":"Person","name":"clue"},"datePublished":"2013-04-20T10:52:07Z","url":"https://github.com/reactphp/reactphp/issues/181"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:63313fdc-c5cd-a103-c5ad-3ea320773914
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF5C:EDA7A:1F75C7:29022F:6B00CBAA
html-safe-nonce0841d9e49b5f23cfccc29d7ae8103920273b83e795728a257f59f0a6d3e9aeef
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjVDOkVEQTdBOjFGNzVDNzoyOTAyMkY6NkIwMENCQUEiLCJ2aXNpdG9yX2lkIjoiMzAxMTEzMjY4NjA0MDM1MzcwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacaf966b6cfbfb0f7fe9d7f6220d758af60b475145e8ae40b6529cd09c303eb3dc
hovercard-subject-tagissue:13432621
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/reactphp/reactphp/181/issue_layout
twitter:imagehttps://opengraph.githubassets.com/41dab6aec73058ae6bb690c07630a12cb13ccada8dc9588430756f9f0b5f0219/reactphp/reactphp/issues/181
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/41dab6aec73058ae6bb690c07630a12cb13ccada8dc9588430756f9f0b5f0219/reactphp/reactphp/issues/181
og:image:altCalling Socket\Server::listen($port, $host) with a hostname instead of an IPv4 address is a blocking operation. Example: $server = new Socket\Server($loop); $server->listen(1234, 'example.com'); Gi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameclue
hostnamegithub.com
expected-hostnamegithub.com
None98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4
turbo-cache-controlno-preview
go-importgithub.com/reactphp/reactphp git https://github.com/reactphp/reactphp.git
octolytics-dimension-user_id1696866
octolytics-dimension-user_loginreactphp
octolytics-dimension-repository_id4287921
octolytics-dimension-repository_nworeactphp/reactphp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id4287921
octolytics-dimension-repository_network_root_nworeactphp/reactphp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseef013399cf0a3c324bea644a685d7c1e0f06b5b7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/reactphp/reactphp/issues/181#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freactphp%2Freactphp%2Fissues%2F181
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freactphp%2Freactphp%2Fissues%2F181
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=reactphp%2Freactphp
Reloadhttps://github.com/reactphp/reactphp/issues/181
Reloadhttps://github.com/reactphp/reactphp/issues/181
Reloadhttps://github.com/reactphp/reactphp/issues/181
reactphphttps://github.com/reactphp
reactphphttps://github.com/reactphp/reactphp
Codehttps://github.com/reactphp/reactphp
Issueshttps://github.com/reactphp/reactphp/issues
Pull requests5 (5)https://github.com/reactphp/reactphp/pulls
Discussionshttps://github.com/reactphp/reactphp/discussions
Actionshttps://github.com/reactphp/reactphp/actions
Wikihttps://github.com/reactphp/reactphp/wiki
Security and qualityhttps://github.com/reactphp/reactphp/security
Insightshttps://github.com/reactphp/reactphp/insights
https://github.com/reactphp/reactphp
New issuehttps://github.com/login?return_to=https://github.com/reactphp/reactphp/issues/181
New issuehttps://github.com/login?return_to=https://github.com/reactphp/reactphp/issues/181
[Socket] Server::listen() is blocking if given a hostnamehttps://github.com/reactphp/reactphp/issues/181#top
dnshttps://github.com/reactphp/reactphp/issues?q=state%3Aopen%20label%3A%22dns%22
https://github.com/clue
cluehttps://github.com/clue
on Apr 20, 2013https://github.com/reactphp/reactphp/issues/181#issue-13432621
herehttps://github.com/clue/socket-react/blob/e7c457e7db8424d468d0dc1fc2ae0bcc31dbe2d6/Socket/React/Stream/Factory.php#L100
herehttps://github.com/clue/socket-react/blob/e7c457e7db8424d468d0dc1fc2ae0bcc31dbe2d6/Socket/React/Datagram/Factory.php#L65
herehttps://github.com/clue/socket-raw/blob/f687c65b20fe9984b248d151e2eb68482bb840f5/Socket/Raw/Factory.php#L36
https://github.com/igorw
igorwhttps://github.com/igorw
on Apr 21, 2013https://github.com/reactphp/reactphp/issues/181#issuecomment-16747094
https://github.com/clue
cluehttps://github.com/clue
on Jun 14, 2014https://github.com/reactphp/reactphp/issues/181#issuecomment-46084392
reactphp/socket#7https://github.com/reactphp/socket/issues/7
cluehttps://github.com/clue
completedhttps://github.com/reactphp/reactphp/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 14, 2014https://github.com/reactphp/reactphp/issues/181#event-131411892
Sign up for freehttps://github.com/signup?return_to=https://github.com/reactphp/reactphp/issues/181
Sign in to commenthttps://github.com/login?return_to=https://github.com/reactphp/reactphp/issues/181
dnshttps://github.com/reactphp/reactphp/issues?q=state%3Aopen%20label%3A%22dns%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.