{"action":"opened","issue":{"url":"https://api.github.com/repos/node-opcua/node-opcua/issues/488","repository_url":"https://api.github.com/repos/node-opcua/node-opcua","labels_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/488/labels{/name}","comments_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/488/comments","events_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/488/events","html_url":"https://github.com/node-opcua/node-opcua/issues/488","id":327633325,"number":488,"title":"Regex in node-opcua-transport/tools flawed","user":{"login":"saenglert","id":6491588,"avatar_url":"https://avatars0.githubusercontent.com/u/6491588?v=4","gravatar_id":"","url":"https://api.github.com/users/saenglert","html_url":"https://github.com/saenglert","followers_url":"https://api.github.com/users/saenglert/followers","following_url":"https://api.github.com/users/saenglert/following{/other_user}","gists_url":"https://api.github.com/users/saenglert/gists{/gist_id}","starred_url":"https://api.github.com/users/saenglert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saenglert/subscriptions","organizations_url":"https://api.github.com/users/saenglert/orgs","repos_url":"https://api.github.com/users/saenglert/repos","events_url":"https://api.github.com/users/saenglert/events{/privacy}","received_events_url":"https://api.github.com/users/saenglert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-30T08:50:05Z","updated_at":"2018-05-30T08:50:05Z","closed_at":null,"author_association":"NONE","body":"**I'm submitting a ...**  (check one with \"x\")\r\n\r\n - (x ) bug report => search github for a similar issue or PR before submitting\r\n\r\n**Current behavior**\r\nThe URL parameter for OPCUAClient.connect(url) requires a trailing `:` but no port number \r\n\r\n**Expected behavior**\r\nThe url should either require a port number or no segment at all (and use default port).\r\nHowever as I'm not really familiar with OPCUA I am unsure whether it defines a default port at all or actually requires the port number. If clarification is given I'm happy to provide a fix in form of a pull request.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n```\r\nimport * as opcua from 'node-opcua';\r\n\r\nconst url: string = 'opc.tcp://192.168.178.142';\r\nconst client: opcua.OPCUAClient = new opcua.OPCUAClient({});\r\n\r\n const init = async () => {\r\n  try {\r\n    await client.connect(url);\r\n  } catch (error) {\r\n    console.log(error);\r\n  } finally {\r\n    try {\r\n      await client.disconnect();\r\n    } catch (error) {\r\n      console.log(error);\r\n    }\r\n  }\r\n};\r\n\r\ninit();\r\n```\r\n```\r\nError: Invalid endpoint url\r\n  at parseEndpointUrl (/Users/sascha/git/opcua_test/node_modules/node-opcua-transport/src/tools.js:70:11)\r\n```\r\n**What is the motivation / use case for changing the behavior?**\r\nEase of use\r\n\r\n**Please tell us about your environment:**\r\nNot relevant in this case\r\n    \r\n* **node-opcua version:** ``\r\ncommit 5f3602169ba85856e92893ffcdfb62c2854d975a\r\n\r\n* **Node:** \r\n   `node --version` = v9.4.0\r\n\r\n"}}
{"actor":{"display_login":"saenglert"}}