diff --git a/pymavlink/mavutil.py b/pymavlink/mavutil.py
index c2869e15cc793f8613769085b2ae302abe86678e..e8a5b596783f06e35c95853115b966553e34678e 100644
--- a/pymavlink/mavutil.py
+++ b/pymavlink/mavutil.py
@@ -1001,6 +1001,11 @@ def mavlink_connection(device, baud=115200, source_system=255,
         set_dialect(dialect)
     if device.startswith('tcp:'):
         return mavtcp(device[4:], source_system=source_system)
+    if device.startswith('udpin:'):
+        return mavudp(device[6:], input=True, source_system=source_system)
+    if device.startswith('udpout:'):
+        return mavudp(device[7:], input=False, source_system=source_system)
+    # For legacy purposes we accept the following syntax and let the caller to specify direction
     if device.startswith('udp:'):
         return mavudp(device[4:], input=input, source_system=source_system)