question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ipv6 client connection fails Error: connect EINVAL

See original GitHub issue

I got the server listening with ipv6 and a percent % with the interface name following For local prefix fe80, but when I go to use Client to connect with wss://[fe80::a00:29?f:fdc2:e0?c]/path There is no connection with _Error: connect EINVAL_

If I include the Ethernet device name wss://[fe80::a00:380f:fe2f:67fd%enp0s3]/path

Error: You must specify a full WebSocket URL, including hostname. Relative URLs are not supported.
    at WebSocketClient.connect 

while a browser is good with just [i::p:v:6] no devicename and curl wants and likes it with the device name? Seems like somewhere in the Client connect it’s improperly understanding proper acceptable ipv6 addresses?!

Note you can also send a %25 to represent the % sign character and again the same with curl it will understand the url encoded percent sign. I’ve tried these with it including trying to backslash the percent sign, so not too many more options left I can think of? Maybe I need something other then ipv6 local addresses prefixed with fe80? alas that would be pretty hacking. Another hack might involve DNS.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
ibccommented, Apr 14, 2017

Said that, it’s true that calling bind() with a link-local IPv6 with scope Id does work.

0reactions
ibccommented, Apr 14, 2017

In RFC 3986: Uniform Resource Identifier (URI): Generic Syntax

   A host identified by an IPv6 literal address is represented inside
   the square brackets without a preceding version flag.  The ABNF
   provided here is a translation of the text definition of an IPv6
   literal address provided in [RFC3513].  This syntax does not support
   IPv6 scoped addressing zone identifiers.

So, to be clear, you should NOT include a IPv6 scope ID into a URL.

I understand your issue, but it’s not something that should be fixed within Node-WebSocket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

connect() returns "invalid argument" with ipv6 address
I have this simple client-server application pair ...
Read more >
netcat producing EINVAL when sending to UDP IPv6 multicast
I'm using netcat on Fedora to test an IPv6 UDP multi-cast address. The command is
Read more >
2005333 – cephadm bootstrap fails to add the host doing the ...
Please make sure that the host is reachable and accepts connections using the ... stderr Error EINVAL: Failed to connect to controller-0 (controller-0)....
Read more >
Class: Socket (Ruby 1.8.6) - Ruby-Doc.org
Errno::EINVAL - the socket is not accepting connections. Errno::EMFILE - OPEN_MAX file descriptors are currently open in the calling process. Errno::ENOBUFS - ...
Read more >
Socket (Ruby 2.3.1) - Class
Ruby's Socket implementation raises exceptions based on the error ... yield socket and client address for each a connection accepted via given sockets....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found